svetlyak40wt / django-perfect404
- Source
- Commits
- Network (0)
- Issues (0)
- Downloads (1)
- Wiki (1)
- Graphs
-
Branch:
master
commit e40cd706542dadffbd540cf6ed6fe8ca9e39d7e4
tree 9d1de5d84d811cdb9df1d40f2f6db527bec1a839
parent 5b37648227ac3a9e6e76f6f5f216a665b1d7a70c
tree 9d1de5d84d811cdb9df1d40f2f6db527bec1a839
parent 5b37648227ac3a9e6e76f6f5f216a665b1d7a70c
| name | age | message | |
|---|---|---|---|
| |
.gitignore | ||
| |
LICENSE | ||
| |
MANIFEST.in | ||
| |
README.md | ||
| |
perfect404/ | ||
| |
setup.py |
README.md
django-perfect404
Easy to install perfect 404 page, based on A List Apart's article.
The main goal of this small project — to provide a simple but flexible way to add an excellent 404 page, which handles referers, broken links, searches from different engines, etc..
Installation
- Place somewhere in your python path or install using
easy_install django-perfect404. - Add
perfect404to the INSTALLED_APPS. - Add
handler404 = 'perfect404.views.page_not_found'to theurls.py.
Customization
If you want to customize your 404 page, then override template 'perfect404.html'. It's context contains following variables:
request_path-- page's location.referer-- URL of the page that refer to the missing one. This variable can be empty string in case if user entered the URL by hand.internal-- boolean variable which is True if broken link is internal.contact-- dict with two keys: 'name' and 'email'. These are taken from settings.ADMINS[0].
TODO
- Add support for search engine referrals and custom links output.
Contribution
Clone this project on GitHub and dont't forget to send me patches! :-)

