17. Model Introspect

17.1. Reverse engineering database

  • python manage.py inspectdb

17.2. Graph Model

$ brew install graphviz
$ pip install pydotplus
$ pip install django-extensions

# Add 'django_extensions' to INSTALLED_APP

$ python manage.py graph_models -a -g -o all.png
$ python manage.py graph_models myapp -g -o myapp.png
$ python manage.py graph_models -a -I Contact,Address -o models.png
$ python manage.py graph_models -a --arrow-shape normal -o myproject.png