Skip to main content

Improve the Sphinx autodoc for Django classes.

Project description

GitHub Workflow Status PyPi Code coverage Black Code Style GitHub license Documentation Status

sphinxcontrib-django2

This is a sphinx extension which improves the documentation of Django apps.

Features

Improvements for the output of Sphinx’s autodoc for Django classes:

  • List all model and form fields as class parameters

  • Improve model field representations

  • Link related and reverse related fields to the referenced class

  • Hide irrelevant runtime information like declared_fieldsets, fieldsets and Meta from classes

  • Add information about autogenerated methods

  • Fix intersphinx mappings to Django modules

  • Custom text roles to cross-reference the documentations of Django (:setting:, :templatetag:, :templatefilter:, :fieldlookup:) and Sphinx (:event:, :confval:)

This is a fork of sphinxcontrib-django, which seems to be no longer maintained.

Installation

Install the package via pip:

pip install sphinxcontrib-django2

Configuration

Add the following to your Sphinx config file conf.py:

# Add source directory to sys.path
sys.path.insert(0, os.path.abspath("../src"))

# Add sphinxcontrib_django2 to installed extensions
extensions = [
    "sphinxcontrib_django2",
]

# Configure the path to the Django settings module
django_settings = "myapp.settings"

Contributing

Pull requests are always welcome!

You can install all requirements of the development setup with the extras dev, test, doc and optional:

python3 -m venv .venv
source .venv/bin/activate
pip install -e .[dev,test,doc,optional]
pre-commit install

Run the tests and generate the coverage report with:

coverage run
coverage html

Build the documentation with:

cd docs
make html

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sphinxcontrib-django2-1.1.tar.gz (17.7 kB view details)

Uploaded Source

Built Distribution

sphinxcontrib_django2-1.1-py2.py3-none-any.whl (19.5 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file sphinxcontrib-django2-1.1.tar.gz.

File metadata

  • Download URL: sphinxcontrib-django2-1.1.tar.gz
  • Upload date:
  • Size: 17.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/53.0.0 requests-toolbelt/0.9.1 tqdm/4.58.0 CPython/3.9.2

File hashes

Hashes for sphinxcontrib-django2-1.1.tar.gz
Algorithm Hash digest
SHA256 99313c7c885bb67cfad47d68d3b939e7df3d01a1cbd16072ba194bcffbf72344
MD5 b01903fc2bccab06e005895bee727cf7
BLAKE2b-256 7cce828bb76acdf73886e583eea879a9a02fb061c158cff86a00414ccc42a2f1

See more details on using hashes here.

File details

Details for the file sphinxcontrib_django2-1.1-py2.py3-none-any.whl.

File metadata

  • Download URL: sphinxcontrib_django2-1.1-py2.py3-none-any.whl
  • Upload date:
  • Size: 19.5 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/53.0.0 requests-toolbelt/0.9.1 tqdm/4.58.0 CPython/3.9.2

File hashes

Hashes for sphinxcontrib_django2-1.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 fe94fbaddddf70fe348e8f73ddb891de20b7c9055e039f1f2e87b17d0d4dbf19
MD5 549012313951df0e364a0b54cc336d31
BLAKE2b-256 f588748c0e45f55b63341f0ee13b9adec7d410cbbd75f6fd9d7ceff4c4e8c2c1

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page