A Django app to provide information about models
Project description
django-model-info
Instantly understand your Django models' structure and relationships with beautiful, intuitive output.
Working with complex Django projects? Need to quickly understand model relationships and fields? django-model-info
is an ideal solution for diving into any Django codebase with confidence.
Why django-model-info?
- Perfect for New Team Members: Quickly understand existing codebases without diving through multiple files
- Great for Documentation: Export beautiful HTML or Markdown documentation of your models' structure
- Ideal for Large Projects: Filter by app or model to focus on what matters
- Time-Saving: Instantly see all fields, relationships, and methods in one place
- Rich Output: Leverages rich for beautiful, clear console output
See an example of the HTML output or the Markdown Output.
Quick Start
- Install the package:
pip install django-model-info
- Add to INSTALLED_APPS:
INSTALLED_APPS = (
...
'django_model_info.apps.DjangoModelInfoConfig',
...
)
- Run the command:
python manage.py model_info
That's it! You'll see a beautiful overview of all your models.
Key Features
-
Multiple Output Levels: Choose from 4 verbosity levels to see exactly what you need
- Level 0: Just model names
- Level 1: Fields and basic method names
- Level 2: Detailed field info and method signatures
- Level 3: Complete information including docstrings and source locations
-
Smart Filtering: Focus on specific apps or models:
python manage.py model_info -f myapp myapp.SpecificModel
- Export Options: Generate documentation in multiple formats:
python manage.py model_info -e documentation.html # HTML output
python manage.py model_info -e documentation.md # Markdown output
- Print Markdown to screen: As an alternative to the rich output:
python manage.py model_info --markdown
- Rich or Markdown Information Display:
- Field types and database representations
- Relationship mappings (forward and reverse)
- Method signatures and locations
- Database details (table names, indexes, etc.)
- Source file locations and line numbers
Configuration
Optionally configure defaults in your Django settings:
# Default verbosity level (0-3)
MODEL_INFO_VERBOSITY = 2
# Default models/apps to display
MODEL_INFO_FILTER = ["myapp", "otherapp.SpecificModel"]
Documentation
For detailed usage and examples, visit our full documentation.
Roadmap
- List manager and queryset methods
- Include signals and other model-level methods
- Add MermaidJS support for visualizing relationships
Contributing
We welcome contributions! This project uses:
License
MIT License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file django_model_info-2024.11.2.tar.gz
.
File metadata
- Download URL: django_model_info-2024.11.2.tar.gz
- Upload date:
- Size: 31.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.4.28
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | bb38921062f95f075bc2cdeb105fb6b72297d541883186d368e651d19fc466a5 |
|
MD5 | b30b6141092ae58d14b6ad1fd117311f |
|
BLAKE2b-256 | 8634c3018b52f4b2fb2ad86201e1fa05df526653aa5f75e86199c1ea5c1d592f |
File details
Details for the file django_model_info-2024.11.2-py2.py3-none-any.whl
.
File metadata
- Download URL: django_model_info-2024.11.2-py2.py3-none-any.whl
- Upload date:
- Size: 33.7 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.4.28
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 27aadd695ce46e64a7189ffcad5a0bc6460a37c08dcfeb3adac119833d8cb403 |
|
MD5 | b24e29c418422cedd7dbdc231adcdc29 |
|
BLAKE2b-256 | f059b68a4e66e8b80f0d8505ac945d3bac95920d9db7686d71265e08c2dd3089 |