django-simple-pages allows you to store HTML documents in models, which can be served automatically without the need for hard-coded URL patterns.
Example use cases include:
Serving a static website.
Handling redirects for relocated resources.
Verifying site ownership for Google Search Console.
Quick-start
Install pip install django-simple-pages.
Add simple_pages to INSTALLED_APPS.
Add simple_pages.middleware.PageFallbackMiddleware to MIDDLEWARE.
Run python manage.py migrate simple_pages.
Usage
Simply navigate to /admin and create a new Page object. A Page consists of the following attributes:
title: The title of the page. This is rendered in the <title> tag if template_name is set to simple_pages/default.html.
access_url: The URL to access this page. All URLs should start with a leading slash.
redirect_url: The URL to redirect to. If set, content will not be rendered.
enabled: When set to True, this page is active. Setting this value to False means that you will see a 404 if you navigate to the page’s access_url.
template_name: The path to the template used to render content. Supported values include:
simple_pages/default.html: Renders a <head> containing a <title> tag, and a <body> containing the page’s content.
simple_pages/raw.html: Renders the page’s content only.
Note: Bold attributes are required.
Changelog
Version |
Description |
|---|---|
0.3 |
Added fade.html template. |
0.2.1 |
Bump version to include all new documentation. |
0.2 |
Admin detail view uses HTML code editor, rather than a plain textarea. |
0.1.1 |
Fixes incorrect help_text on Page.template_name. |
0.1 |
Initial version. |
Metadata
Release files for django-simple-pages 0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| django-simple-pages-0.3.tar.gz | 138.5 kB | Without provenance | Details for django-simple-pages-0.3.tar.gz |
Release files / django-simple-pages-0.3.tar.gz
| Download URL | django-simple-pages-0.3.tar.gz |
|---|---|
| Size | 138.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6cdbff206eae62811542d8da9297696b64b2211a53dbf91760318606812aa939
|
|
BLAKE2b-256 checksum How to use checksums |
7ec9d4e44af8f484ae9b54912831957c2cf89d6b475518e60980f84bd2597f40
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
Python-urllib/3.6
|
Security for django-simple-pages 0.3
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.