Simple Django healthcheck middleware
- Install the package:
pip install django-healthz
- Add "healthz" to your INSTALLED_APPS settings like this:
INSTALLED_APPS = [
...
'healthz',
]
- Include the healtheck middleware in the django middleware:
MIDDLEWARE = [
'healthz.middleware.HealthCheckMiddleware',
...
]
- Configure the readiness checks:
HEALTHCHECK = {
'READINESS_CHECKS': ('databases', 'caches', 'queues',)
}
- Update responses to JSON
- Allow customization or readiness and healthz URLs.