- Home
- Skills
- Carlos Asg
- Tu Voz En Ruta
- Django Health
django-health_skill
- Python
0
GitHub Stars
1
Bundled Files
2 months ago
Catalog Refreshed
4 months ago
First Indexed
Readme & install
Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.
Installation
Preview and clipboard use veilstrat where the catalogue uses aiagentskills.
npx veilstrat add skill carlos-asg/tu-voz-en-ruta --skill django-health- SKILL.md9.5 KB
Overview
This skill configures django-health-check for Django apps to expose monitoring endpoints, Docker HEALTHCHECKs, and Kubernetes liveness/readiness probes. It provides patterns for public-schema URL placement, built-in checks (database, migrations, cache), and how to add custom checks. The goal is reliable container orchestration, load-balancer routing, and external uptime monitoring.
How this skill works
It installs and registers django-health-check and its plugins so the app exposes /health/ (HTML or JSON) and component URLs like /health/db/ and /health/migrations/. Health checks run fast, non-authenticated validations (DB connectivity, pending migrations, cache/storage) and can register custom checks via BaseHealthCheckBackend. Docker and Kubernetes probe snippets call /health/ with short timeouts so orchestrators act on failures.
When to use it
- Deploying Django in Docker or Kubernetes and needing liveness/readiness probes
- Adding simple, machine-readable health endpoints for load balancers or uptime monitors
- Verifying DB connectivity and pending migrations in automated deployments
- Integrating monitoring systems (UptimeRobot, Prometheus via metrics)
- Multi-tenant apps that require public-schema health endpoints
Best practices
- Expose health endpoints in the public schema or routing layer so orchestration can reach them
- Keep checks lightweight and fast; avoid expensive queries or tenant-specific work
- Use database and migrations checks to detect schema drift early
- Add Docker HEALTHCHECK in the Dockerfile and match timeouts to app startup behavior
- Configure Kubernetes liveness vs readiness separately (restart vs remove from service) with conservative initialDelaySeconds
- Return JSON for programmatic checks and ensure endpoints require no authentication
Example use cases
- Add /health/ to the public URL conf so Kubernetes can probe without tenant middleware
- Use docker HEALTHCHECK CMD curl -f http://localhost:8000/health/ to mark unhealthy containers
- Register a custom TenantCountCheck to surface non-critical tenant warnings in CI or dashboards
- Monitor /health/?format=json with an external uptime service and alert on 500 or timeouts
- Combine /metrics/ (django-prometheus) and /health/ for both metrics and simple availability checks
FAQ
No. Health endpoints must be publicly reachable by orchestrators and monitors; keep them unauthenticated and lightweight.
Where should I place health URLs in a multi-tenant app?
Put health URLs in the public schema URL conf (PUBLIC_SCHEMA_URLCONF) so Docker and Kubernetes can reach them without tenant routing.