| 23 | | {{{ |
| 24 | | python modelviz.py myapp myotherapp > app.dot |
| 25 | | }}} |
| 26 | | For more options, run with `--help` |
| 27 | | |
| 28 | | Once you use this python script to generate the dot file ({{{app.dot}}}), you should be able to open it with [http://www.graphviz.org/ Graphviz]. To convert to a png, ensure you have {{{dot}}} installed (part of Graphviz), and issue: |
| 29 | | {{{ |
| 30 | | dot app.dot -Tpng -o app.png |
| 31 | | }}} |
| 32 | | |
| 33 | | == Other References == |
| 34 | | |
| 35 | | You might also be interested in [http://www.exit66.com/diagram.zip this Django app by Andrew Barilla ] from which I borrowed some ideas, that displays the graphviz results directly from the web. |
| 36 | | |
| 37 | | [http://code.google.com/p/django-command-extensions/ Django-extensions] (formerly named Django-command-extensions) provides a command to visualize your models. Using an improved version of the modelviz script. It also includes/supports grouping of your Django applications. Which will group all models of a single app together. This makes larger projects much easier and clearer to view. |
| 38 | | |
| 39 | | Usage: |
| 40 | | {{{ |
| 41 | | # download django-extensions and include it in your app. |
| 42 | | $ ./manage.py graph_models -a -g -o my_project.png |
| 43 | | }}} |
| | 18 | Follow the steps from the original documentation [http://django-extensions.readthedocs.org/en/latest/graph_models.html] |