Installing django extensions
#for windows
pip install django-extensions
# for mac/linux
pip3 install django-extensions
Installing Grapviz in your maching
#for windows
pip install graphviz
# for mac/linux
pip3 install graphviz
Add django extensions in settings.py
INSTALLED_APPS = [
...
'django_extensions',
...
]
Add the following Code anywhere in settings.py
GRAPH_MODELS = {
'all_applications' : True,
'group_model' : True ,
}
Create the .dot output and convert to .png
# windows
python manage.py graph_models -a > output.dot
# mac / linux
python3 manage.py graph_models -a > output.dot
Then create the PNG file
dot -Tpng output.dot -o output.png
or You can create the PDF file also
dot -Tpng output.dot -o output.pdf
Do you have any Query?
join me then
Linkedin : yeazin
facebook : yeazin
email : naz.yeasin@gmail.com