Generate Django pages from Markdown, HTML, and Django template files.
Project description
Django Nanopages
Generate Django pages from Markdown, HTML, and Django template files.
Integrates well with:
- nanodjango, to build a simple site with a single Python script
- django-distill, to generate a static site
- django-style, for clean base templates
- django-browser-reload, for automatic browser reloading
Read the documentation or find the project on PyPI.
Creating pages
Nanopages supports
page.md- markdownpage.html- Django template
Where two files have the same name, the markdown file will be used. These would both be
served at /page/
HTML files are treated as Django templates, so you can also override blocks.
Files called index are special - they are the default content for their path, eg
section/index.mdwill be served at/section/section/page.mdwill be served at/section/page/
Source pages can also provide context for your Django templates - see context documentation
Quickstart
Try the example
Try out the example site using nanodjango:
git clone https://github.com/radiac/django-nanopages.git
cd django-nanopages/example
uv run example/website.py
Using with nanodjango
-
Install nanodjango along with its optional dependencies, including django-nanopages and django-distill:
pip install nanodjango[full]
-
In your nanodjango script, register your directory of pages at a URL, at the end of your script:
app.pages(url="", path="pages/")
-
Put your markdown, HTML, or Django template files under the
path- in this case, a dir next to your script called "pages". -
Optional: build to a static site with django-distill:
nanodjango manage myscript.py distill-local static_site/
(see django-distill docs for more configuration and deployment options)
Using with full Django
-
Install:
pip install django-nanopages
-
Add it to your
INSTALLED_APPSinsettings.py:INSTALLED_APPS = [ ... "django_nanopages", ]
-
In your
urls.py, register your directory of pages at a URL:from django_nanopages import Pages urlpatterns = [ ... path("", Pages("pages/")), ]
-
Put your markdown, HTML, or Django template files under the
path- in this case, a dir called "pages". -
Optional: build to a static site with django-distill:
./manage.py distill-local static_site/
(see django-distill docs for more configuration and deployment options)
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
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 django_nanopages-0.3.1.tar.gz.
File metadata
- Download URL: django_nanopages-0.3.1.tar.gz
- Upload date:
- Size: 10.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4b03da99e1290d7b4f856d332e56e22d8caff4e576657a6666e454dda6bbedf8
|
|
| MD5 |
ae08737399d0ea3eeaaf9ed48470f903
|
|
| BLAKE2b-256 |
1f989a26cf5d0b4d902f2e40bcc9937d16d498451949b6c7441cf3e33b75851b
|
Provenance
The following attestation bundles were made for django_nanopages-0.3.1.tar.gz:
Publisher:
pypi.yml on radiac/django-nanopages
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
django_nanopages-0.3.1.tar.gz -
Subject digest:
4b03da99e1290d7b4f856d332e56e22d8caff4e576657a6666e454dda6bbedf8 - Sigstore transparency entry: 829656129
- Sigstore integration time:
-
Permalink:
radiac/django-nanopages@9a5c337ea5dd2f6c2a329c7fb363c101d14dd0ca -
Branch / Tag:
refs/tags/v0.3.1 - Owner: https://github.com/radiac
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi.yml@9a5c337ea5dd2f6c2a329c7fb363c101d14dd0ca -
Trigger Event:
push
-
Statement type:
File details
Details for the file django_nanopages-0.3.1-py3-none-any.whl.
File metadata
- Download URL: django_nanopages-0.3.1-py3-none-any.whl
- Upload date:
- Size: 9.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9ef7e54d8915d41b6cb2d5213d1144c7d1e6f183eef593b90bc9bcbb15d92031
|
|
| MD5 |
b496e621eee793d7515fc0259e6dc868
|
|
| BLAKE2b-256 |
8ea28db684009cd8cd0087fa1a0ed10a0dc23730c5b35d63ed241100b771953b
|
Provenance
The following attestation bundles were made for django_nanopages-0.3.1-py3-none-any.whl:
Publisher:
pypi.yml on radiac/django-nanopages
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
django_nanopages-0.3.1-py3-none-any.whl -
Subject digest:
9ef7e54d8915d41b6cb2d5213d1144c7d1e6f183eef593b90bc9bcbb15d92031 - Sigstore transparency entry: 829656131
- Sigstore integration time:
-
Permalink:
radiac/django-nanopages@9a5c337ea5dd2f6c2a329c7fb363c101d14dd0ca -
Branch / Tag:
refs/tags/v0.3.1 - Owner: https://github.com/radiac
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi.yml@9a5c337ea5dd2f6c2a329c7fb363c101d14dd0ca -
Trigger Event:
push
-
Statement type: