Skip to content

Instantly share code, notes, and snippets.

@vanishinggradient
Forked from gregelin/django_erd_steps.md
Created August 19, 2021 15:46
Show Gist options
  • Save vanishinggradient/7f6809911ebade8695da6556c6f5c4b7 to your computer and use it in GitHub Desktop.
Save vanishinggradient/7f6809911ebade8695da6556c6f5c4b7 to your computer and use it in GitHub Desktop.
Generating ERD for django projects
# Install django-extensions
# http://django-extensions.readthedocs.io/en/latest/installation_instructions.html
pip3 install django-extensions

# Add django-extensions INSTALLED_APPS in siteapp > settings.py
# INSTALLED_APPS = (
#    ...
#    'django_extensions',
# )

# You may need to install pyparsing
pip3 install pyparsing

# examples:
python3 manage.py graph_models -a -g -o my_project_visualized.png
python3 manage.py graph_models -a -o my_project.png
python3 manage.py graph_models -a > my_project.dot
# for a single django app:
python3 manage.py graph_models app1 -o my_project_app1.png
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment