sphinxcontrib-django
Improve the Sphinx autodoc for Django classes.
What it is and what it does
sphinxcontrib-django is a Sphinx extension designed to make Django application documentation more complete and readable. It hooks into Sphinx's autodoc system to automatically extract and display Django model and form fields as class parameters, improve how those fields are represented in the generated docs, and create intelligent links between related and reverse-related fields. It also hides internal Django implementation details that clutter documentation (like declared_fieldsets and Meta classes) and adds information about autogenerated methods.
The extension is configured by adding it to your Sphinx conf.py alongside a django_settings module path. It provides custom text roles for cross-referencing Django documentation (settings, template tags, filters, field lookups) and Sphinx internals (events, config values), and includes optional features like displaying database table names and controlling how many field choices to show. It handles Django setup during the documentation build process and emits a django-configured event so you can run custom initialization code safely.
Use it for:
- Generate complete API documentation for Django models that automatically lists all fields and their types without manual effort.
- Create cross-referenced Django project documentation where field relationships link directly to the related model classes.
- Build cleaner autodoc output by filtering out internal Django implementation details that add noise to generated docs.
- Document custom Django admin forms and model fields with improved field representations and metadata.
- Set up monkeypatching or custom initialization during documentation builds via the django-configured event hook.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
A Sphinx extension that enhances autodoc output for Django classes by listing model and form fields as parameters, improving field representations, and adding cross-reference roles for Django and Sphinx documentation.
Yes. This is a stable, actively maintained extension for a common use case—documenting Django projects with Sphinx. It has low install friction, no known vulnerabilities, permissive licensing, and solves a real problem (Django's internal structure makes vanilla autodoc output cluttered and incomplete). Install it if you're using Sphinx to document a Django application.
Install
sphinxcontrib-django on PyPI
pip
pip install sphinxcontrib-djangouv
uv add sphinxcontrib-djangopoetry
poetry add sphinxcontrib-djangoInstalling sphinxcontrib-django
Before you install
Low friction installation with only three runtime dependencies (Django, Sphinx, pprintpp). Actively maintained as of 2026-07-20 with a stable release history since 2017-12-07, supporting modern Python versions (3.8 through 3.11) and recent Django versions (3.2, 4.1, 4.2).
License in practice
Licensed under Apache 2.0 (permissive), allowing free use, modification, and distribution with minimal restrictions—suitable for both open-source and commercial projects.
Quickstart
pip install sphinxcontrib-django
# In your Sphinx conf.py:
import sys, os
sys.path.insert(0, os.path.abspath("../src"))
extensions = ["sphinxcontrib_django"]
django_settings = "myapp.settings"
Requires Django settings module to be configured; the extension emits a django-configured event after django.setup() completes for custom initialization code.
Verify before relying
- Whether the package works with Django versions beyond 4.2 or Python versions beyond 3.11.
- Performance impact when documenting large Django projects with many models and fields.
- Compatibility with recent Sphinx versions not explicitly listed in classifiers.
Package facts
| License | Apache2 2.0 License (permissive) |
| Python support | supports the current Python release (>=3.8) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 3 — Django, Sphinx, pprintpp |
| Maintenance | actively maintained — 1,053 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 122,107/month — #11,960 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: sphinxcontrib_django-2.5-py3-none-any.whl
Keywords: django, docstrings, extension, sphinx
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
autodocsummA Sphinx extension that enhances autodoc with…
permissive · top 5,000 on PyPI
sphinx-issuesA Sphinx extension that adds roles for linking…
permissive · top 15,000 on PyPI
sphinxcontrib-autoyamlA Sphinx extension that auto-generates…
permissive · top 15,000 on PyPI
sphinxcontrib-apidocA Sphinx extension that automatically runs…
permissive · top 15,000 on PyPI
autoclasstocGenerates a structured table of contents for…
unclear · top 15,000 on PyPI
sphinx-autodoc-typehintsAutomatically extracts Python type hints from…
permissive · top 5,000 on PyPI
autodoc_pydanticSphinx extension that automatically generates…
permissive · top 15,000 on PyPI
sphinx-autodoc2sphinx-autodoc2 generates API documentation for…
permissive · top 15,000 on PyPI
sphinxcontrib-napoleonA Sphinx extension that converts Google and…
permissive · top 15,000 on PyPI
sphobjinvInspect, search, and manipulate Sphinx…
permissive · top 15,000 on PyPI