Skip to main content
=============================
django-watchman
=============================

.. image:: https://badge.fury.io/py/django-watchman.png
:target: http://badge.fury.io/py/django-watchman

.. image:: https://travis-ci.org/mwarkentin/django-watchman.png?branch=master
:target: https://travis-ci.org/mwarkentin/django-watchman

.. image:: https://coveralls.io/repos/mwarkentin/django-watchman/badge.png?branch=master
:target: https://coveralls.io/r/mwarkentin/django-watchman?branch=master

django-watchman exposes a status endpoint for your backing services like
databases, caches, etc.

.. image:: https://s3.amazonaws.com/snaps.michaelwarkentin.com/watchmenozy.jpg

Documentation
-------------

The full documentation is at http://django-watchman.rtfd.org.

Quickstart
----------

1. Install ``django-watchman``::

pip install django-watchman

2. Add ``watchman`` to your ``INSTALLED_APPS`` setting like this::

INSTALLED_APPS = (
...
'watchman',
)

3. Include the watchman URLconf in your project ``urls.py`` like this::

url(r'^watchman/', include('watchman.urls')),

4. 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
}
}
]
}

Features
--------

Token based authentication
**************************

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

Custom checks
*************

django-watchman allows you to customize the checks which are run by modifying
the ``WATCHMAN_CHECKS`` setting. In ``settings.py``::

WATCHMAN_CHECKS = (
'module.path.to.callable',
'another.module.path.to.callable',
)

Checks now have the same contract as context processors: they consume a
``request`` and return a ``dict`` whose keys are applied to the JSON response::

def my_check(request):
return {'x': 1}

In the absence of any checks, a 404 is thrown, which is then handled by the
``json_view`` decorator.

Run a subset of available checks
********************************

A subset of checks may be run, by passing ``?check=module.path.to.callable&check=...``
in the request URL. Only the callables given in querystring, which are in the
``WATCHMAN_CHECKS`` should be run, eg::

curl -XGET http://127.0.0.1:8080/watchman/?check=watchman.views.caches_status

Default checks
--------------

By default, django-watchman will run checks against your databases
(``watchman.views.databases_status``) and caches (``watchman.views.caches_status``).
These will function even if you haven't configured the respective settings.




History
-------

0.2.0 (2014-09-04)
++++++++++++++++++

* Custom checks can now be written and run using the ``WATCHMAN_CHECKS`` setting
* A subset of the available checks can be run by passing the ``check`` GET param
when hitting the watchman url

0.1.2 (2014-02-21)
++++++++++++++++++

* Move package requirements out of requirements.txt and into setup.py

0.1.1 (2014-02-09)
++++++++++++++++++

* Remove ``django>=1.5.5`` version specification
* Remove ``wheel`` requirement


0.1.0 (2014-02-08)
++++++++++++++++++

* First release on PyPI.

Release files for django-watchman 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-watchman 0.2.0
File Size Uploaded
django-watchman-0.2.0.tar.gz 7.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for django-watchman 0.2.0
File Interpreter ABI Platform
django_watchman-0.2.0-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size: 17.2 kB

Release files / django-watchman-0.2.0.tar.gz

Download URL django-watchman-0.2.0.tar.gz
Size 7.9 kB
Tags Source
SHA-256 checksum
How to use checksums
d5e7d38e0f2f8da43a736fd21f6f3a36186fe58bc473cd32149ea3ab6224fe9c
BLAKE2b-256 checksum
How to use checksums
4e2fc76b18db2800e88c266d242912ed2338c3569dce40fc71efc74923255d37
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / django_watchman-0.2.0-py2.py3-none-any.whl

Download URL django_watchman-0.2.0-py2.py3-none-any.whl
Size 9.3 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
f4577d952b7b32170d360335e72a4df2d47f1fa9190b84646d7204264a8f64a8
BLAKE2b-256 checksum
How to use checksums
7502ccf1923fc98f1fa87f0367c3dba18b0a62718a1ccf52df982d48f6a4b9fc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

1.5.0

2 release files

1.4.0

2 release files

1.3.0

2 release files

1.2.0

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.0

2 release files

0.18.0

2 release files

0.17.0

2 release files

0.16.0

2 release files

0.15.0

2 release files

0.13.1

2 release files

0.13.0

2 release files

0.12.0

2 release files

0.11.1

2 release files

0.11.0

2 release files

0.9.0

2 release files

0.8.0

2 release files

0.7.1

2 release files

0.6.0

2 release files

0.5.0

1 release file

0.4.0

2 release files

0.3.0

2 release files

0.2.2

2 release files

0.2.1

2 release files

This release

0.2.0 This release

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page