superleader / django-graphviz

Automatically exported from code.google.com/p/django-graphviz
0 stars 0 forks source link

ImportError: No module named django_graphviz-0.1 #1

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Hello,

I have problem using django-graphviz version 0.1 on Mac OS X 10.5.7
(Intel-based CPU). Downloaded from here
http://django-graphviz.googlecode.com/files/django_graphviz-0.1.zip,
unpacked and run:

iM2:django_graphviz-0.1 ostry$ sudo python manage.py modelviz testapp >
testapp.dot
Password:
Traceback (most recent call last):
  File "manage.py", line 11, in <module>
    execute_manager(settings)
  File
"/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/d
jango/core/management/__init__.py",
line 338, in execute_manager
    setup_environ(settings_mod)
  File
"/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/d
jango/core/management/__init__.py",
line 316, in setup_environ
    project_module = __import__(project_name, {}, {}, [''])
ImportError: No module named django_graphviz-0.1

Could you provide some documentation, how to overcome this? Thanks in advance.

Jan Ostrochovsky
jan(dot)ostrochovsky+django-graphviz(at)gmail(dot)com

Original issue reported on code.google.com by jan.ostr...@gmail.com on 20 Jul 2009 at 9:54

GoogleCodeExporter commented 8 years ago
rename the directory django_graphviz-0.1 to django_graphviz if you're using the
default project. Or add 

'yourproject.graphviz' to settings.py INSTALLED_APPS

Original comment by sedit...@gmail.com on 24 Aug 2009 at 6:39

GoogleCodeExporter commented 8 years ago
Here are my steps documented:

Printing Django Models as block diagrams

Installing GraphVis support on OSX - Mark Eckdahl
2011-10-26

Tasks accomplished:
Install Graphics Engine (GraphVis)
Install Python driver (pygraphvis)
Install application to export models (django-extensions)
Export models to image files from command line

After a bit of a hassle here is what worked for me on Snow Leopard version of 
OSX.

1.  Download and install the Application GraphVis version 2.26.3 version (a bit 
more OSX friendly than 2.28 from notes on site) - This is the graphics display 
engine software.

    http://www.graphviz.org/pub/graphviz/stable/macos/snowleopard/

2.  Install Python driver to link to GraphVis - pygraphvis

    pip install pygraphviz

3.  Install django-command-extensions - Note I actually downloaded source and 
ran [sudo python setup.py install] from source folder as part of my debugging, 
but probably overkill.

      pip install django-extensions

3b. I copied the django_extensions folder from the distribution into my [apps] 
folder for my Django project, note this is not the top level folder, but a sub 
folder.  Again probably overkill.

4.  Edit your settings.py file and add the following in the INSTALLED_APPS 
(generally you will have a list, and just add {'django_extensions',} to the 
list.

      INSTALLED_APPS = ('django_extensions',)

5.  Then with your project directory as your current directory, enter this code 
at the command prompt: (Note: /path/to/image{.png} should be replaced with the 
your desired file name for generated image file)

      python manage.py graph_models -a -g -o /path/to/image.png

=============================================
Original reference From:
http://ygamretuta.me/2011/02/08/django-1-2-output-an-image-graph-of-your-models/

Django 1.2 – Output An Image Graph of Your Models

   1.

      install required packages by entering this code:

      apt-get install graphviz python-pygraphviz graphviz-dev

   2.

      then install pygraphviz in Python

      pip install pygraphviz

   3.

      install django-command-extensions

      pip install django-extensions

   4.

      then edit your settings.py file and add the following in the INSTALLED_APPS

      INSTALLED_APPS = ('django_extensions',)

   5.

      then with your project directory as your current directory, enter this code

      python manage.py graph_models -a -g -o /path/to/image.png

and that’s it!

Original comment by mark.eckdahl on 26 Oct 2011 at 10:17