Skip to main content

Provides a simple view for mdBooks, allowing them to exist within a Django site. Note that because all requests are proxied through the MdBookView, it will be a bit slower than using Apache or Nginx directly; however, using a Django view allows fine-grained access control.

Example use:

import os.path

from django.contrib.auth.decorators import permission_required
from django.urls import path
from django.views.generic import RedirectView

from django_mdbook.views import MdBookView

directory = os.path.dirname(__file__)


def rel_to_abs(path: str) -> str:
    """
    Given a path relative to this file, give its absolute name
    :param path: a relative path to resolve
    :return: an absolute path
    """
    return os.path.join(directory, path)

urlpatterns = [
    path('doc/foo/',
        RedirectView.as_view(url='index.html', permanent=True),
        name='foo_doc_index'),
    path('doc/foo/<path:path>',
        permission_required('doc.foo_documentation')(
            # Note: book_root is the directory with book.toml, not the built directory
            MdBookView.as_view(book_root=rel_to_abs('foo'))),
        name='foo_docs')
]

Metadata

Release files for django-mdbook 0.2.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-mdbook 0.2.0
File Size Uploaded Provenance Actions
django-mdbook-0.2.0.tar.gz 2.9 kB Without provenance Details for django-mdbook-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for django-mdbook 0.2.0
File Interpreter ABI Platform Actions
django_mdbook-0.2.0-py3-none-any.whl Python 3 none any Details for django_mdbook-0.2.0-py3-none-any.whl

Total release size: 6.8 kB

Release files / django-mdbook-0.2.0.tar.gz

Download URL django-mdbook-0.2.0.tar.gz
Size 2.9 kB
Tags Source
SHA-256 checksum
How to use checksums
0e5b7811ff5b3fe5599c1b40c9e4b775f2ad9d861bbea01547c7ca86dffdd238
BLAKE2b-256 checksum
How to use checksums
06975c7a8413d4db33d1c7975418bd3ff3026119e1d679861e2a879dbff46462
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.29.1 CPython/3.7.2

Release files / django_mdbook-0.2.0-py3-none-any.whl

Download URL django_mdbook-0.2.0-py3-none-any.whl
Size 3.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2e039dc8f72d8ffc0c1cf2a99db5547cb8e2c3c750d22c140d07c9c7c44a9f8b
BLAKE2b-256 checksum
How to use checksums
fc8d57031d866ea1ca064565b7ce8a9861485444d56015cc096c148dcb8cc215
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.29.1 CPython/3.7.2

Security for django-mdbook 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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