As django project get bigger, it is hard to see all app's model relationships (ForeignKey's, ManyToMany Fields). Is there any program that can make easy looking graph of model relationship?
django extensions has a command to do this
pip install django-extensions
settings:
INSTALLED_APPS = (
...
'django_extensions',
)
run command
manage.py graph_models --pygraphviz -a -g -o my_project_visualized.png
First setup using this Graphviz
Go through step by step:
after this install graphviz or mac using
$ brew install graphviz
use this command to generate database documentation using Schemaspy
and graphviz
:
java -jar schemaSpy_5.0.0.jar -t pgsql -db `db_name` -host 127.0.0.1 -u `db_user` -p admin -o ./schemaspy -dp postgresql-9.4-1206-jdbc4.jar -s public -noads
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With