django-doctor is a Django pluggable application for checking the operational status of a Django installation. It includes checking that caching and storage is correctly set up, that email is working, etc.
This is an early draft, so use it at your own risk.
django-doctor (available on PyPi):
pip install django-doctor
Add it to
INSTALLED_APPS in your
settings.py (so Django can locate
INSTALLED_APPS += ['doctor']
And add it to your root URLconf:
urlpatterns = patterns('', url(r'^doctor/', include('doctor.urls')), ... )
These are the available configurable settings, along with their default values:
||The template all the doctor templates should inherit from|
||Paths to service check classes.|
||Paths to storage classes to check.|
We are working on making a pluggable structure for the service check, work in progress. Checks for cache, Celery, email and storages are currently included by default.
Run unit tests by running
python setup.py test
Write and run health checks just as tests
How to run health checks with nose
Use nose's attrib plugin to select only tests with "is_healthcheck" attribute:
nosetests --all-modules --attr="is_healthcheck"
The "--all-modules" option is required because, by default, nose's will ignore tests in the "healthchecks" directory, because of the match pattern. See also "--match" option.
- Set up the project tests so they can run standalone
- Refine the service class approach
- Include sending of test email in a view?
- Implement more health checks:
- request.is_secure() is properly set up