Migration to version 4.x
Important
Version 3.21 started deprecating the old settings, checks, and APIs. To make the switch easier, versions >=3.21 still support both the OLD and NEW configuration styles.
- If you have
health_check.dbin yourINSTALLED_APPS, revert the migration to drop theTestModeltable:
python manage.py migrate db zero
- Update the dependencies. Include the extras for the checks you want to use.
uv add 'django-health-check[psutil,celery,kafka,rabbitmq,redis,rss,atlassian]>=4.0.0'
-
Remove these
health_check.*sub‑apps fromINSTALLED_APPS. Keephealth_check! -
Remove all
HEALTH_CHECK_*settings from your settings file. -
Replace the URL include with the view and explicit
checkslist. Before:
# urls.py
path("ht/", include("health_check.urls"))
After (example):
# urls.py
from health_check.views import HealthCheckView
path(
"ht/",
HealthCheckView.as_view(
checks=[
"health_check.Cache",
"health_check.Database",
"health_check.Mail",
"health_check.Storage",
# 3rd party checks
"health_check.contrib.psutil.Disk",
"health_check.contrib.psutil.Memory",
"health_check.contrib.celery.Ping",
"health_check.contrib.rabbitmq.RabbitMQ",
"health_check.contrib.redis.Redis",
]
),
name="health_check",
)
Removals and Replacements
- The classes
StorageHealthCheck,DefaultFileStorageHealthCheck,S3BotoStorageHealthCheck, andS3Boto3StorageHealthCheckare replaced with Storage. CeleryHealthCheckis replaced with Ping.MigrationsHealthCheckis removed. Django's check framework covers its function.DatabaseHealthCheckis replaced with Database. It does not require a table. It supports multiple database aliases.