This project aims at providing a compromise between dynamic error pages for Django (that use template tags etc and therefore potentially error too) and having to write static error pages by hand.
Project description
This project aims at providing a compromise between dynamic error pages for Django (that use template tags etc and therefore potentially error too) and having to write static error pages by hand.
It does so by providing a management command that can be invoked to turn a dynamic Django template into a static HTML page with no template tags whatsoever in it.
Note that this means that every time you change your error pages, you need to re-run this script. Ideally this is part of your deploy process.
Installation
pip install django-statictemplate inside your virtualenv.
Add statictemplate to your INSTALLED_APPS.
Usage
python manage.py statictemplate dynamic_500.html > 500.html
The management command renders a template given by name (standard Django template name resolution applies) and writes the output to stdout, so you should redirect stdout to a filename.
License
This project is licensed under the BSD license.
Contributors
See https://github.com/ojii/django-statictemplate/contributors
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
File details
Details for the file django-statictemplate-1.1.tar.gz
.
File metadata
- Download URL: django-statictemplate-1.1.tar.gz
- Upload date:
- Size: 3.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a9ade7fc1431d533382912e97d669da009b094378a93b3de543edc98ec5be99d |
|
MD5 | d7d45d9e2e77600f71ca37fd4e364c9e |
|
BLAKE2b-256 | b9e1b79dba7c8d476d64459046628d36373952ad27ba65ff4e797ea8bc36ce61 |