Reusable Django app that serves an mkdocs-built site from the same Django project the app is installed in, behind a configurable access gate.
Project description
mkview
Reusable Django app that serves an mkdocs-built site from the same Django project the app is installed in, behind a configurable access gate.
Usage
# settings.py
INSTALLED_APPS = [
...,
"mkview",
]
# urls.py
urlpatterns = [
...,
path("docs/", include("mkview.urls")),
]
Build the docs with mkdocs build and the site is served at /docs/.
Settings
All optional:
-
MKVIEW_ACCESS_CALLBACK— callable (or dotted path to one) taking the request and returning a bool, same pattern as django-debug-toolbar'sSHOW_TOOLBAR_CALLBACK. Default: superusers (request.user.is_superuser). Anonymous users are redirected toLOGIN_URL; authenticated users failing the gate get a 403. Any extra conditions (e.g.is_active) are the callback's responsibility.# e.g. open the docs up to staff users MKVIEW_ACCESS_CALLBACK = lambda request: request.user.is_staff
-
MKVIEW_SITE_DIR— path to the mkdocs build output. Default: thesite_dirread fromBASE_DIR/mkdocs.yml(mkdocs' own default:site). Reading mkdocs.yml requires PyYAML.
The site dir must stay out of STATIC_ROOT — anything there is served
publicly, bypassing the access callback.
Tests
From a project with the app installed:
python manage.py test mkview
Or standalone, from this repo (what CI runs):
python -m django test mkview --settings=test_settings
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mkview-0.1.1.tar.gz.
File metadata
- Download URL: mkview-0.1.1.tar.gz
- Upload date:
- Size: 5.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2d78d00edac0d0aa5073164350f394cbdd3c9d011e4c9f1a29bd25dfe0083f86
|
|
| MD5 |
df386acdd0a2719f99228f850ab172b9
|
|
| BLAKE2b-256 |
7a8f50f6e9d1bf205e318ca94748c87a98ac872e01f6a73293b56a193f90e5c9
|
Provenance
The following attestation bundles were made for mkview-0.1.1.tar.gz:
Publisher:
release.yml on anibalpacheco/mkview
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mkview-0.1.1.tar.gz -
Subject digest:
2d78d00edac0d0aa5073164350f394cbdd3c9d011e4c9f1a29bd25dfe0083f86 - Sigstore transparency entry: 1797680647
- Sigstore integration time:
-
Permalink:
anibalpacheco/mkview@0df36fcc725f1f23b3101620be51e6006aafd6d3 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/anibalpacheco
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@0df36fcc725f1f23b3101620be51e6006aafd6d3 -
Trigger Event:
push
-
Statement type:
File details
Details for the file mkview-0.1.1-py3-none-any.whl.
File metadata
- Download URL: mkview-0.1.1-py3-none-any.whl
- Upload date:
- Size: 6.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6dffebaadeb798b4eca96c1cf3296f5257426dc7dc61ad9a75b89451ffe123b6
|
|
| MD5 |
bea89ff146b8b04e84253b357ea23b01
|
|
| BLAKE2b-256 |
818c7903a190888f9623d497f297c7bb08b02d4b96a4c2bdcfbf5fa33521452f
|
Provenance
The following attestation bundles were made for mkview-0.1.1-py3-none-any.whl:
Publisher:
release.yml on anibalpacheco/mkview
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mkview-0.1.1-py3-none-any.whl -
Subject digest:
6dffebaadeb798b4eca96c1cf3296f5257426dc7dc61ad9a75b89451ffe123b6 - Sigstore transparency entry: 1797680801
- Sigstore integration time:
-
Permalink:
anibalpacheco/mkview@0df36fcc725f1f23b3101620be51e6006aafd6d3 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/anibalpacheco
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@0df36fcc725f1f23b3101620be51e6006aafd6d3 -
Trigger Event:
push
-
Statement type: