Generate DATABASE.md schema documentation for Django projects and LLM agents
Project description
django-db-schema-doc
Generate DATABASE.md — full schema documentation for developers and LLM/AI agents — from any database configured in your Django project's DATABASES.
Supports PostgreSQL, MySQL/MariaDB, Microsoft SQL Server, SQLite, Oracle, and other backends Django can introspect.
Install
pip install django-db-schema-doc
Setup
Add to INSTALLED_APPS:
INSTALLED_APPS = [
# ...
"db_schema_doc",
]
Usage
python manage.py generate_database_doc
Writes DATABASE.md in your project BASE_DIR by default.
Common options
python manage.py generate_database_doc -o docs/schema.md
python manage.py generate_database_doc --with-row-counts
python manage.py generate_database_doc --database reporting
python manage.py generate_database_doc --project-hints "See accounts_childuserrelation for parent-child links."
Run python manage.py generate_database_doc --help for all options.
What is generated
- Connection metadata (engine, vendor, database — no passwords)
- Tables grouped by name prefix (
app_modelstyle) - Hub tables (most referenced by foreign keys)
- Table of contents with anchors
- Foreign key index
- Per table: columns, types, PKs, indexes, incoming/outgoing FKs
On PostgreSQL, MySQL, and SQL Server, foreign keys include ON DELETE / ON UPDATE rules when available.
Requirements
- Python 3.10+
- Django 4.2+
- Your project's database driver (e.g.
psycopg,mysqlclient,mssql-django)
License
MIT — see 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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file django_db_schema_doc-1.0.0.tar.gz.
File metadata
- Download URL: django_db_schema_doc-1.0.0.tar.gz
- Upload date:
- Size: 11.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c4b5cf9479e426cefbfdc81f4b47967dab986a17b95153d2c584826901667061
|
|
| MD5 |
077bf1957819638b958b16a68f162ce2
|
|
| BLAKE2b-256 |
fdf2c5a4a38a27abd7cfd271529e5a2d98f4bfffcec90fe318e1f98e796bb615
|
File details
Details for the file django_db_schema_doc-1.0.0-py3-none-any.whl.
File metadata
- Download URL: django_db_schema_doc-1.0.0-py3-none-any.whl
- Upload date:
- Size: 12.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
faab0c2a8c578ca51a5833c4990c45134930d979ff9182a140634b4fedf8345f
|
|
| MD5 |
ff86245d0282bc55180799260593c2bb
|
|
| BLAKE2b-256 |
eae17f831d874a5f1d8a1db7aa3bdf0648752a50119a8fa12885bae042f1d027
|