Changes between Version 34 and Version 35 of DjangoGraphviz
- Timestamp:
- Nov 30, 2010, 8:51:30 PM (14 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
DjangoGraphviz
v34 v35 1 1 = Converting Django models into Graphviz DOT files = 2 2 3 Inspired by [http://www.hackdiary.com/archives/000093.html this nice hack by Matt Biddulph], this is a Python script that generates a GraphvizDOT file for quick visualizations of Django model definitions.3 Inspired by [http://www.hackdiary.com/archives/000093.html this nice hack by Matt Biddulph], this is a Python script that generates a [http://www.graphviz.org/ Graphviz] DOT file for quick visualizations of Django model definitions. 4 4 5 5 == Source code == 6 6 7 [http://unicoders.org/code/django/trunk/utils/modelviz.py View online] or [http://code.unicoders.org/django/trunk/utils/modelviz.py download from Subversion repository] (you could also set it as a svn:external on your repository to keep up to date with the latest revisons.) 8 9 === Checkout === 10 {{{ 11 svn co svn://unicoders.org/unicoders/django/trunk/utils/ modelviz 12 }}} 7 The [http://code.google.com/p/django-command-extensions/ Django-extensions] version seems to be most up-to-date. You only need this file, not the whole project: 8 http://github.com/django-extensions/django-extensions/blob/master/django_extensions/management/modelviz.py 13 9 14 10 == Examples == … … 25 21 == Command == 26 22 27 Once you use this python script to generate the dot file ({{{app.dot}}}), ensure you have {{{dot}}} installed (part of Graphviz), and issue: 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: 28 29 {{{ 29 30 dot app.dot -Tpng -o app.png … … 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. 35 36 36 [http://code.google.com/p/django-command-extensions/ Django-extensions] (formerly named Django-command-extensions) alreadyprovides 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.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. 37 38 38 39 Usage: … … 42 43 }}} 43 44 44 45 45 == Feedback == 46 46