django-watchman exposes a status endpoint for your backing services like databases, caches, etc.
The full documentation is at http://django-watchman.rtfd.org.
Install
django-watchman
:pip install django-watchman
Add
watchman
to yourINSTALLED_APPS
setting like this:INSTALLED_APPS = ( ... 'watchman', )
Include the watchman URLconf in your project
urls.py
like this:url(r'^watchman/', include('watchman.urls')),
Start the development server and visit
http://127.0.0.1:8000/watchman/
to get a JSON response of your backing service statuses:{ "databases": [ { "default": { "ok": true } } ], "caches": [ { "default": { "ok": true } } ] }
If you want to protect the status endpoint, you can add a WATCHMAN_TOKEN
to your settings. When this setting is added, you must pass that value in as the watchman-token
GET parameter:
GET http://127.0.0.1:8000/watchman/?watchman-token=:token
If you want to change the token name, you can set the WATCHMAN_TOKEN_NAME
. The value of this setting will be the GET parameter that you must pass in:
WATCHMAN_TOKEN_NAME = 'custom-token-name'
GET http://127.0.0.1:8000/watchman/?custom-token-name=:token