To support zero-downtime deployments, configure a health check endpoint in your Django application. This endpoint allows Sevalla to verify that your app is running correctly before routing traffic to it. There are multiple ways to implement a health check in Django, depending on the level of control and visibility required.Documentation Index
Fetch the complete documentation index at: https://docs.sevalla.com/llms.txt
Use this file to discover all available pages before exploring further.
Option 1: Use an existing view
If you don’t want to create a new endpoint, you can reuse an existing public view as the health check. The chosen path should return a successful response only when critical dependencies, such as the database or other required services, are functioning correctly. If a failure occurs, the view should return an error status.Option 2: Create a dedicated health check view
For more control and clarity, you can create a simple, dedicated health check endpoint. This view can explicitly verify core dependencies, such as database connectivity, by callingconnection.ensure_connection(). If a connection cannot be established, an exception is raised, and the endpoint returns an error response, indicating the application is unhealthy.