My favorites | Sign in
Project Home
Search
for
GraphModels  
Renders a graphical overview of your project or specified apps.
Phase-Implementation, Phase-Deploy
Updated Feb 4, 2010 by v.oostv...@gmail.com

Creates a GraphViz dot file for the specified app names. You can pass multiple app names and they will all be combined into a single model. Output is usually directed to a dot file.

With the latest revisions it's also possible to specify an output file if pygraphviz is installed and render directly to an image or other supported filetype.

Example Usage

With django-command-extensions installed you can create a dot-file or an image by using the graph_models command. Like used in the following examples:

# Create a dot file
$ ./manage.py graph_models -a > my_project.dot
# Create a PNG image file called my_project_visualized.png with application grouping
$ ./manage.py graph_models -a -g -o my_project_visualized.png
# Create a dot file for only the 'foo' and 'bar' applications of your project
$ ./manage.py graph_models foo bar > my_project.dot

Example Rendered Graphics

The following graphs are from the PyCon-Tech project. PyCon-Tech is a conference management framework based on Django framework.

Pycon-Tech Project

Big-Image

Pycon-Tech Project Overview With Grouping

Big-Image

Comment by bsr...@gmail.com, Dec 17, 2008

For google to find this: this is a python database schema visualization solution.

Comment by thomas...@gmail.com, Feb 12, 2009

working link to pygraphviz

Comment by graham_g...@gkgk.org, Aug 24, 2009

For pygraphviz on Ubuntu:

sudo apt-get install graphviz-dev; sudo apt-get install python-pygraphviz

Comment by jays...@gmail.com, Nov 1, 2009

I had trouble getting this to work in OS X Leopard, finally found this solution which did:

http://magicrebirth.wordpress.com/2009/10/14/installing-pygraphviz-tested-on-osx-leopard/

Comment by Alessand...@gmail.com, Mar 30, 2010

I'd like to not output columns types and to exclude some Models. Looks it's not supported, right?

Comment by dmbs...@gmail.com, Nov 24, 2010

Anyone know of a graphviz gui editor, something that can just move nodes around is all I want. I tried dotty which seems to be a tool for creating random boxes all over my graph.

Comment by fcorr...@gmail.com, Mar 29, 2011

Would be awesome if the output was a true UML class diagram. Or at least, if generalization relations were represented with that notation (white-filled triangle arrow).

Comment by felipe.a...@gmail.com, Nov 30, 2011

To use pygraphviz in a virtual env, use venv-dependencies to link it. Like: sudo apt-get install graphviz-dev; sudo apt-get install python-pygraphviz sudo pip install venv-dependencies

then in the virtual-env do:

link_venv.py "pygraphviz" And it'ts ready to go.

https://github.com/arruda/venv-dependencies

Comment by rgmi...@gmail.com, Dec 6, 2011

Thought this might help others:

I wanted to graph one of my django apps, so I used this syntax:

python manage.py graph_models myapp > myapp.dot

And I used this line to convert it into a PNG:

dot -Tpng myapp.dot > myapp.png

Comment by anggiaj, Dec 14, 2011

Hi is anybody had GeoDjango? class diagram?


Sign in to add a comment
Powered by Google Project Hosting