81

I'm searching a way to represent my Django project model graphically.

Is there a "native" way to do this kind of ERD (diagram) ?


Update following @Etienne instructions

Here is an example of how I finally view the PDF representing some models of my django project

$ python manage.py graph_models app1 app2 ... | dot -Tpdf | evince
  • It generates the dot data with my applications (app1, app2, ...)
  • Passes the result to dot to output into PDF format
  • Opens the output with evince
1

2 Answers 2

106

If you want to extract UML diagram from your Django models you can use the Graph models command of django-extensions. Another one that do mostly the same thing: django-graphviz.

If you want to create your Django models from UML: uml-to-django.

And to create UML diagrams, there's Dia, yED and ArgoUML

You can check also this list of tools.

5
  • I'll use django-extension with pygraphviz (when I succeed in installing them:) Jul 21, 2011 at 15:01
  • 1
    I just submitted a pull-request to allow use of PyDot instead of PyGraphViz; which means you won't need to worry about C extensions ;)
    – A T
    Feb 24, 2013 at 6:31
  • 24
    -1: UML is not ERD. Dec 11, 2013 at 19:39
  • 2
    There is no current way to use graphviz with Python3 ATM.
    – nerdoc
    Oct 31, 2014 at 8:07
  • @nerdoc do you mean this error: TypeError: can't use a string pattern on a bytes-like object ? That's what I'm getting on Python3. Aug 24, 2017 at 22:29
6

Best I can think of is Argo UML which requires you to design by hand (and then you can convert the UML into Django with this tool)

If you want to do django - uml conversion (the other way) try looking at Django To UML

2
  • 7
    You can still use a tool like Argo to create your ERD diagrams. Anyway, if you have a better option, post your answer :) Just downvoting because our answers are "hacks" around a problem and not the perfect solution is a bit cocky. Cheers. Dec 12, 2013 at 11:33
  • The link to Argo UML has changed to this: argouml-tigris-org.github.io/tigris/argouml and I couldn't find an updated link of Django to UML documentation.
    – moojen
    Mar 10, 2023 at 11:40

Not the answer you're looking for? Browse other questions tagged or ask your own question.