Skip to main content

Generate docs for django models

Generate extensible Markdown documentation for Django models. Developed for cross-team collaboration when iterating on on data model specifications.

User quickstart with an existing Django project

Install into your project requirements (git+https://github.com/jakekara/django-model-docs.git)

Add to the Django settings INSTALLED_APPS.

Generate Markdown documentation YOUR_APP

python manage.py generate-model-docs YOUR_APP

Dev quick start

# set up a virtual env however you like. here's what I like:
python -m venv venv 
. ./venv bin activate

# set up dev stuff
pip install -r requirements.txt

# install the package in editable mode
pip install -e .

# generate docs for model(s) in the demo app
cd demo_django_project
python manage.py generate-model-docs demo_django_app

The output looks like this at the moment:

# `demo_django_app`` app`

_This file was auto-generated Django Model Docs Generator.  Do not edit this file directly._

A demo Django App. Note that this text will be pulled from the app's docstring and used in the default output of `generate-model-docs`.

## `person` model

Person(id, first_name, last_name, shoeStyle)

|    Field   |Description|                                                          Data type                                                         |Nullable|Default|
|------------|-----------|----------------------------------------------------------------------------------------------------------------------------|--------|-------|
|    `id`    |           |                                                        BigAutoField                                                        |  False |   -   |
|`first_name`|           |                                                          CharField                                                         |  False |   -   |
| `last_name`|           |                                                          CharField                                                         |  False |   -   |
| `shoeStyle`|           |CharField<br><br>Choices (stored value : human readable)<br><br>- `LO` : `LOAFER`<br>- `BO` : `BOOT`<br>- `DR` : `DRESS`<br>|  False |   -   |

Tests

Tests need to be run in the context of the demo_django_app.

cd demo_django_project
python manage.py test django-model-docs

To run the test suite against every supported Python version, use the command tox (you must have each Python version available to tox). You should see output like:

  py39: OK (2.44=setup[2.08]+cmd[0.36] seconds)
  py310: OK (2.04=setup[1.75]+cmd[0.30] seconds)
  py311: OK (2.19=setup[1.86]+cmd[0.33] seconds)
  py312: OK (6.02=setup[5.63]+cmd[0.39] seconds)
  congratulations :) (12.72 seconds)

If you're using pyenv to manage versions, you need to run pyenv local 3.9 3.10 3.11 3.12 to make these versions accessible to tox from in the project environment.

Metadata

Release files for django-model-docs 0.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-model-docs 0.0.0
File Size Uploaded
django-model-docs-0.0.0.tar.gz 12.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for django-model-docs 0.0.0
File Interpreter ABI Platform
django_model_docs-0.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 29.1 kB

Release files / django-model-docs-0.0.0.tar.gz

Download URL django-model-docs-0.0.0.tar.gz
Size 12.5 kB
Tags Source
SHA-256 checksum
How to use checksums
ceba69677307f11f5d520a3615efd62521ede19c76484cb51402b56427bb1d62
BLAKE2b-256 checksum
How to use checksums
45c5b4753e5482e267f3a3fb42c6c43b3d13d46cbd36b4dbd46a9e6609391bbd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.18

Release files / django_model_docs-0.0.0-py3-none-any.whl

Download URL django_model_docs-0.0.0-py3-none-any.whl
Size 16.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1b366c347c0db97a42104889ad7999dde37cd047ceda73977ffb7ce57607aa05
BLAKE2b-256 checksum
How to use checksums
13e17cf6718d76212c6478c95cb9fc1142aeecfcd7e1bf5b9bf42242ad6e7f05
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.18

Release history Release notifications | RSS feed

This release

0.0.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page