79

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
Pierre de LESPINAY
  • 44,700
  • 57
  • 210
  • 307
  • It's awesome to see from the one deleted answer (why has it been deleted?) a small project evolved: https://github.com/LegoStormtroopr/django-spaghetti-and-meatballs – Daniel W. Dec 25 '20 at 01:43

2 Answers2

105

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.

RickyA
  • 15,465
  • 5
  • 71
  • 95
Etienne
  • 12,440
  • 5
  • 44
  • 50
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

Vini.g.fer
  • 11,639
  • 16
  • 61
  • 90
Samuele Mattiuzzo
  • 10,760
  • 5
  • 39
  • 63
  • 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. – Samuele Mattiuzzo Dec 12 '13 at 11:33
  • The link to Argo UML has changed to this: https://argouml-tigris-org.github.io/tigris/argouml/ and I couldn't find an updated link of Django to UML documentation. – moojen Mar 10 '23 at 11:40