Welcome to djohno’s documentation!¶
djohno is a reusable Django app for ensuring your error views and templates work properly. djohno adds views which intentionally trigger HTTP 403, HTTP 404 and HTTP 500 responses. There are also views for ensuring your site email facilities are set up correctly.
All djohno views are restricted to users with superuser access.
djohno
also adds default 403.html
, 404.html
and
500.html
templates, which you should override.
Contents¶
Installation¶
djohno is available for install from PyPI:
pip install djohno
Once it’s in your virtualenv, add it to your INSTALLED_APPS
:
INSTALLED_APPS = (
...
'djohno',
)
Note
It’s important to make sure djohno
is listed after all other
apps which have templates you care about, since djohno includes
some templates that aren’t scoped to a djohno
subdirectory
(namely, 403.html
, 404.html
, 500.html
). You should have
other apps (or perhaps templates in TEMPLATE_DIRS
) which
provide those templates, so ensure those apps are listed before
djohno
. If you’re using templates for 403.html
et al in
TEMPLATE_DIRS
, make sure
'django.template.loaders.filesystem.Loader'
is listed before
'django.template.loaders.app_directories.Loader'
in your
TEMPLATE_DIRS
setting.
Once you’ve added djohno
to your INSTALLED_APPS
, add djohno to
your urls.py
:
urlpatterns = patterns(
'',
...
url(r'^djohno/', include('djohno.urls')),
)
Finally, you’ll need to deploy djohno’s static files, with:
python manage.py collectstatic
Usage¶
Once installed, simply visit djohno/
in your browser, and try the
links to the 403, 404, 500 and mail integration pages.
Supported Python and Django versions¶
Currently, djohno supports Django 1.4, 1.5, 1.6 and 1.7. Djohno follows Django’s lead in the versions of Python it supports (i.e. with Django 1.5 and above, djohno will support Python 3).
Release Notes¶
Table of Contents
0.2.0 (13th April 2015)¶
- Official, tested, support for Django 1.7 and 1.8;
- Switched to py.test for testing;
- Removed version checks (the ability to compare versions of currently installed libraries vs what’s available on PyPI) - the checks were a bit hacky, since there’s not a common API for determining the version of a given app that’s installed, and it wasn’t much use in practice.
0.1.6 (27th July 2013)¶
- Tests and minor fix to ensure djohno works with the upcoming release
of Django 1.6 (
webmaster@localhost
became a valid email address indjango.core.validators.validate_email
in Django 1.6). - Slightly improved tests (back to 100% coverage).
- Added classifiers to setup.py.
0.1.5 (23rd July 2013)¶
- Added images to documentation and
README.md
to show what djohno looks like. - Made layout responsive, so it behaves better at lower screen sizes.
- Made the mail view initially just display information about email
settings, with a separate
@require_POST
view for actually sending the email. - Slightly nicer styling of headings in templates.
0.1.4 (19th July 2013)¶
- Also include
sys.path
in the versions page. - Add margin to the table of app versions.
- Added a favicon for the djohno views.
- Added a convenient
handler500
method which includesSTATIC_URL
, and include information on how to configure your project to use it in the default500.html
template. - Attempt to identify what the latest version number for apps is in the versions page, and highlight apps that are out of date.
0.1.3 (17th July 2013)¶
- Change the 500 view to just raise an exception
djohno.views.DjohnoTestException
, so that we actually activate the error logging stuff correctly.
0.1.2 (15th July 2013)¶
- Test re-organising (separated view tests and utility tests), added test descriptions.
- Better styles for buttons (based on Flat UI, from http://designmodo.github.io/Flat-UI/).
- Added a “versions” view to see versions of apps in
INSTALLED_APPS
(similar to, and based on, the versions panel in Django Debug Toolbar).
0.1.1 (29th June 2013)¶
- Fix the email address the test email is sent from, add checking that it’s a valid email address, and encourage users to set DEFAULT_FROM_EMAIL to a friendly address (Your Name <you@yourcompany.com>);
- Ensure setup.py has a short and a long description;
- Improved documentation.
0.1.0 (27th June 2013)¶
- Initial release
Steps for Preparing a Release¶
- Increment the version number in
__init__.py
. - Update the release notes in
docs/release_notes.rst
. - Update the version in
docs/conf.py
. - Ensure the release notes in the documentation have the current date as the release date.
- Create a git tag (format
X.Y.Z
). - Run
tox
. git push
python setup.py sdist upload