19.2. Django Extensions
GraphViz + Dot
Graphviz https://graphviz.org/
Django Extensions: https://django-extensions.readthedocs.io/en/latest/graph_models.html#example-usage
19.2.1. Install
# macOS
$ brew install graphviz
# Ubuntu Linux
$ sudo apt install graphviz
# Windows
https://graphviz.org/download/
Install dependencies:
$ python -m pip install pydotplus
$ python -m pip install django-extensions
Append to myproject/settings.py
:
INSTALLED_APPS += ['django_extensions']
19.2.2. Usage
Run in system terminal:
$ python manage.py graph_models -a -g -o all.png
$ python manage.py graph_models shop -g -o shop.png
$ python manage.py graph_models -a -I Contact,Address -o models.png
$ python manage.py graph_models -a --arrow-shape normal -o shop.png