Writing a custom health check

Writing a health check is quick and easy:

fromhealth_check.backendsimportBaseHealthCheckBackendclassMyHealthCheckBackend(BaseHealthCheckBackend):defcheck_status(self):# The test code goes here.# You can use `self.add_error` or# raise a `HealthCheckException`,# similar to Django's form validation.passdefidentifier(self):returnself.__class__.__name__# Display name on the endpoint.

After writing a custom checker, register it in your app configuration: