Skip to main content

Serve static pages from templates

Project description

Current Release License

Serve flat pages from templates. Advantages:

  • No database hits

  • Keep your pages in a version control system

Installation

Install the latest release with pip:

pip install django-sfp

Configuration

  1. Add sfp to your INSTALLED_APPS.

  2. Add sfp.middleware.SfpFallbackMiddleware to your MIDDLEWARE settings.

  3. Create a pages template directory. This should be a subdirectory of one of the templates in your TEMPLATES setting. Any templates you include here (except for a base.html) will get served as a static page.

For example, assuming your project-level template directory is named “templates”, then:

  • The url /about/ will render templates/pages/about.html

  • The url /about/team/ will render templates/pages/about/team.html

Settings

To serve pages/index.html as homepage use this setting:

SFP_HANDLE_HOMEPAGE = True

Edit pages online

To edit pages at runtime you can use django-dirtyedit

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-sfp-0.6.tar.gz (4.5 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page