Open GoogleCodeExporter opened 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
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
Original issue reported on code.google.com by
jan.ostr...@gmail.com
on 20 Jul 2009 at 9:54