about 8 years ago

When you have large number of models, it is eaiser to understand their relationships by looking at a graph, Django extensions has a handy command to convert these relationships into an image file:

  1. Install Django extension by:
pip install django-extensions

 2. Enable Django extensions in your settings.py:

  INSTALLED_APPS = (
    ...
    'django_extensions',
  )

 3. Install graph packages that Django extensions relies on for drawing:

pip install pyparsing==1.5.7 pydot

 4. Use this command to draw:

./manage.py graph_models -a -g -o my_project_visualized.png

For more drawing options, please refer to the offical doc.

← Sublime Text 3 Markdown How to send responsive HTML Email →
 
comments powered by Disqus