Skip to main content

Allows to serve Sphinx generated docs from django.

Project description

django-sphinx-docs

pypi license

django-sphinx-docs allows to serve Sphinx generated docs directly from Django.

This is a fork of https://github.com/littlepea/django-docs to support Django 4.0+.

Dependencies

  • Python 3.10+
  • Django 3.2+

Installation

  1. Install django-sphinx-docs package:

    pip install django-sphinx-docs
    
  2. Add django_sphinx_docs to INSTALLED_APPS in settings.py:

    INSTALLED_APPS = (
        ...
        'django_sphinx_docs',
        ...
    )
    
  3. Add django_sphinx_docs.urls to urls.py:

    urlpatterns = [
        ...
        path('docs/', include('django_sphinx_docs.urls')),
        ...
    ]
    
  4. Customize configuration:

    DOCS_ROOT = os.path.join(PROJECT_PATH, '../docs/_build/html')
    DOCS_ACCESS = 'staff'
    

Configuration

DOCS_ROOT (required)

Absolute path to the root directory of html docs generated by Sphinx (just like STATIC_ROOT / MEDIA_ROOT settings).

DOCS_ACCESS (optional)

Docs access level (public by default). Possible values:

  • public - (default) docs are visible to everyone
  • login_required - docs are visible only to authenticated users
  • staff - docs are visible only to staff users (user.is_staff == True)
  • superuser - docs are visible only to superusers (user.is_superuser == True)

Running the tests

uv run pytest

Running the example project

cd example
uv run python manage.py migrate
uv run python manage.py runserver

Project details


Download files

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

Source Distribution

django_sphinx_docs-0.3.3.tar.gz (29.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

django_sphinx_docs-0.3.3-py3-none-any.whl (6.2 kB view details)

Uploaded Python 3

File details

Details for the file django_sphinx_docs-0.3.3.tar.gz.

File metadata

  • Download URL: django_sphinx_docs-0.3.3.tar.gz
  • Upload date:
  • Size: 29.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for django_sphinx_docs-0.3.3.tar.gz
Algorithm Hash digest
SHA256 e1501a935f2388e2696d684e3b0f75b8f5afed3c2ae93cf32d50c5e38f591bdb
MD5 47024d6cd953ced02a5f603773639a46
BLAKE2b-256 e6b74a516c7f018e214bb05ba1f1bcea9ec3e5689d5af998bf4620359c285881

See more details on using hashes here.

Provenance

The following attestation bundles were made for django_sphinx_docs-0.3.3.tar.gz:

Publisher: publish.yml on adamghill/django-sphinx-docs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file django_sphinx_docs-0.3.3-py3-none-any.whl.

File metadata

File hashes

Hashes for django_sphinx_docs-0.3.3-py3-none-any.whl
Algorithm Hash digest
SHA256 6960087a830c98942b284403725d6c6efefbbaa229579623e88e3c08f6587763
MD5 5c988ae0b64b731964e0733f05804416
BLAKE2b-256 534ec3c152c5a71ecec6ae51dd54ca9a903150fbbd393075cebc959fcb61fcc4

See more details on using hashes here.

Provenance

The following attestation bundles were made for django_sphinx_docs-0.3.3-py3-none-any.whl:

Publisher: publish.yml on adamghill/django-sphinx-docs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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