Adds some common health check endpoints (ping, time, status)
Project description
Django-Health-Checks
Django-Health-Checks is Django plugin which adds a few health check endpoints (ping, time, and status) to the Django project.
Add health_checks to your settings.py INSTALLED_APPS
INSTALLED_APPS += ('health_checks',)
Add health_checks urls
import health_checks urlpatterns += [ url('r^', include('health_checks.urls')), ]
Add some custom status jobs
from health_checks import status_job @status_job(name="PostgreSQL", timeout=5) def postgresql(): # Perform a ping/query to Postgres @status_job def facebook # Ping some Facebook service.
- You now have the below endpoints:
/ping/ (returns a 200 “pong”)
/time/
{ "epoch": 1.463770977e+09, "local": "2016-05-20T19:02:57.558686471Z", "offset": 0, "utc": "2016-05-20T19:02:57.558686471Z", "zone": "UTC" }
/status/
{ "endpoints": [ { "duration": 0.028509, "endpoint": "PostgreSQL" }, { "duration": 0.018747, "endpoint": "facebook", "error": "socket.gaierror: [Errno -2] Name or service not known" }, ... }
get Django-Health-Checks
Install django
easy_install django-health-checks or pip install django-health-checks
Download the latest release from Python Package Index or clone the repository
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file Django-Health-Checks-0.0.1.tar.gz
.
File metadata
- Download URL: Django-Health-Checks-0.0.1.tar.gz
- Upload date:
- Size: 4.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3dbb1428b516780012898acda5a5fea50d0ca5e94882abe1458b17e161a3250c |
|
MD5 | d065cb38138de69415c67135fecba934 |
|
BLAKE2b-256 | 76bd5dbd7fc20a6ce85a2d27090edaf253970eb85bf510928ad74d4af5bc2fc3 |