Skip to main content

Model-based HTML pages and redirects.

Project description

travis codacy coverage pypi

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.


  1. Install pip install django-simple-pages.

  2. Add simple_pages to INSTALLED_APPS.

  3. Add simple_pages.middleware.PageFallbackMiddleware to MIDDLEWARE.

  4. Run python migrate simple_pages.


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.





Added fade.html template.


Bump version to include all new documentation.


Admin detail view uses HTML code editor, rather than a plain textarea.


Fixes incorrect help_text on Page.template_name.


Initial version.

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-simple-pages-0.3.tar.gz (138.5 kB view hashes)

Uploaded source

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page