like flatpages, but with templates.
Project description
like flatpages, but with templates
This is like Django’s contrib.flatpages, but without the database. It’s just static html documents served from your filesystem.
Motivation
I’ve been using the flatpages app for a long time, but somewhere along the line I started keeping my flatpage content (snippets of html) in the git repo with the rest of my project. Any time I made a change to a flatpage, I’d edit the file locally, commit the changes, then copy and paste the new content into the relevant flatpage.
Why not just serve these from my templates directory?
That’s what staticflatpages does.
Installation
Install this app with pip:
pip install django-staticflatpages
Or install it directly from this repo:
pip install -e git+git://github.com/bradmontgomery/django-staticflatpages.git#egg=django-staticflatpages
Configuration
Add staticflatpages to your INSTALLED_APPS.
Add staticflatpages.middleware.StaticFlatpageFallbackMiddleware to your MIDDLEWARE_CLASSES
Create a staticflatpages template directory. This should be a subdirectory of one of the templates in your TEMPLATE_DIRS. 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”, the url /about/ will point to templates/staticflatpages/about.html. Likewise, the url /about/team/ will point to templates/staticflatpages/about/team.html.
License
This code is distributed under the terms of the MIT license. See the LICENSE file.
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
Hashes for django-staticflatpages-0.1.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9d9bf1437ee950b7036e2ec987ff22b1b2d3275b0a2eba34cbee15c72bacbcb1 |
|
MD5 | 18db4652563ca784274e7bbdf5792967 |
|
BLAKE2b-256 | 03dd046ac15633fc53a5bed8005997e044819e36ae79ce21459aa5698aea2706 |