Getting Started¶
This guide will help you install and begin using django-model-info to explore your Django models.
Installation¶
Prerequisites¶
Before installing django-model-info, ensure your environment meets the following requirements:
Python: Version 3.10 or higher
Django: Version 4.2 or higher
Dependencies:
rich: Automatically installed with the package for console outputnetworkx: Required if usingmodelgraphcommandpydot: Required if usingmodelgraphcommand
System packages (optional):
graphviz: Required formodelgraphDOT format output (install viaapt install graphviz,brew install graphviz, etc.)
Installation Methods¶
Via pip¶
pip install django-model-info
Adding to INSTALLED_APPS¶
Add django-model-info to your Django project’s INSTALLED_APPS:
INSTALLED_APPS = (
...
'django_model_info.apps.DjangoModelInfoConfig',
...
)
This will install four new management commands:
Verifying Installation¶
To verify the installation was successful, run:
python manage.py help modelinfo
You should see the help text for the modelinfo command. If you receive an error, ensure that:
The package is installed (
pip list | grep django-model-info)The app is properly added to
INSTALLED_APPSYour virtual environment is activated (if using one)