Skip to main content

django-deploy-probes

Production-ready deployment probes for Django applications, with HTTP endpoints and an in-process CLI runner.

Use django-deploy-probes for CI/CD deployment validation, Docker health checks, Kubernetes probes, blue-green deployments, and rollback checks.

PyPI Django Packages Python Django License uv

Documentation

Install

pip install django-deploy-probes

Supported runtimes:

  • Python 3.10 through 3.14
  • Django 5.2 LTS, Django 6.0, and Django 6.1

The 0.3.x release line remains available for projects that still require Django 4.2.

Optional extras:

pip install "django-deploy-probes[redis]"
pip install "django-deploy-probes[celery]"
pip install "django-deploy-probes[openapi]"
pip install "django-deploy-probes[all]"

Quick Start

INSTALLED_APPS = [
    "django_deploy_probes",
]
from django.urls import include, path

urlpatterns = [
    path("", include("django_deploy_probes.urls")),
]

Verify over HTTP:

curl -f http://localhost:8000/healthz
curl -f http://localhost:8000/readyz
curl -f http://localhost:8000/version

Or run the same probes in-process from Django:

python manage.py deploy_probes healthz --json
python manage.py deploy_probes readyz --json
python manage.py deploy_probes startupz --json
python manage.py deploy_probes version --json

The CLI reuses the same probe payload contract as the HTTP endpoints. Use it for CI/CD steps, pre-deploy validation, container bootstrap checks, and local debugging. For Kubernetes liveness, readiness, and startup probes, keep using HTTP endpoints as the default integration.

Custom check messages are hidden by default. If you enable EXPOSE_CHECK_MESSAGES=True, do not include secrets or sensitive values in those messages.

Security checks use REMOTE_ADDR by default. If probes are accessed through a trusted reverse proxy, configure TRUSTED_PROXY_NETWORKS and CLIENT_IP_HEADER to resolve the original client IP safely.

Storage checks use Django storage aliases, so the same probe can validate local filesystems, S3-compatible backends, and any custom storage backend wired through STORAGES.

Common settings

DEPLOY_PROBES = {
    "SERVICE_NAME": "my-django-app",
    "ENVIRONMENT": "prod",
    "VERSION": "1.2.0",
    "READY_CHECKS": ["database", "redis", "celery", "storage"],
    "STARTUP_CHECKS": ["migrations"],
    "READY_CUSTOM_CHECKS": [],
    "STARTUP_CUSTOM_CHECKS": [],
    "DATABASES": ["default"],
    "STORAGE": {
        "default": {
            "CHECK": "exists",
            "PATH": "probes/ready.txt",
        },
        "s3_media": {
            "CHECK": "write",
            "PREFIX": "deploy-probes",
        },
    },
    "REDIS": {
        "default": {
            "LOCATION": "redis://localhost:6379/0",
            "TIMEOUT": 1.0,
        },
    },
    "CELERY": {
        "BROKER": True,
        "WORKERS": False,
        "RESULT_BACKEND": False,
        "TIMEOUT": 1.0,
    },
    "DETAIL_LEVEL": "none",
    "INCLUDE_CHECK_DURATIONS": False,
    "REQUIRE_READY_CHECKS": False,
    "REQUIRE_STARTUP_CHECKS": False,
    "EXPOSE_CHECK_MESSAGES": False,
    "INTERNAL_IP_ONLY": False,
    "INTERNAL_IP_NETWORKS": [
        "127.0.0.1/32",
        "::1/128",
        "10.0.0.0/8",
        "172.16.0.0/12",
        "192.168.0.0/16",
    ],
    "TRUSTED_PROXY_NETWORKS": [],
    "CLIENT_IP_HEADER": None,
}

STORAGE supports two practical modes:

  • CHECK="exists": verify that a known probe object exists.
  • CHECK="write": create and delete a temporary object to verify write access.

For S3, exists is safer when you already manage a sentinel object like probes/ready.txt. Use write when you want to validate bucket write/delete permissions during readiness checks.

Timeout contract

There is no global probe timeout. Redis and Celery apply their TIMEOUT values only to operations whose client APIs support a real timeout:

  • REDIS[alias]["TIMEOUT"]: Redis connect and socket timeout.
  • CELERY["TIMEOUT"]: Celery broker connection and worker ping timeout.

Database, migration, storage, Celery result backend, and custom checks use their backend-native timeout configuration. Checks run sequentially, so set Kubernetes timeoutSeconds or an upstream load balancer timeout above the worst-case sum of the enabled checks.

With DETAIL_LEVEL="safe", recognized timeout exceptions return {"status": "fail", "reason": "timeout"}. See the timeout contract for configuration guidance.

Development

uv sync --all-extras --dev
uv run pytest -q
uv run mkdocs build --strict

Publishing is handled by .github/workflows/publish.yml when a GitHub release is published. Documentation is deployed to GitHub Pages from main by .github/workflows/docs.yml.

See the contributing guide for suitable contribution areas, test levels, and compatibility rules.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django_deploy_probes-0.6.0.tar.gz (52.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

django_deploy_probes-0.6.0-py3-none-any.whl (22.0 kB view details)

Uploaded Python 3

File details

Details for the file django_deploy_probes-0.6.0.tar.gz.

File metadata

  • Download URL: django_deploy_probes-0.6.0.tar.gz
  • Upload date:
  • Size: 52.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for django_deploy_probes-0.6.0.tar.gz
Algorithm Hash digest
SHA256 57657b09d90136b38072ffd3b5166774427ecf38f8d3852f14a5206fd2ea5e1e
MD5 93a0a98f5e8bf217cd1bdfe65c910782
BLAKE2b-256 7726ce26914a348acc7ddda25333aca1971af3347394797bda6bdc878065e35e

See more details on using hashes here.

File details

Details for the file django_deploy_probes-0.6.0-py3-none-any.whl.

File metadata

  • Download URL: django_deploy_probes-0.6.0-py3-none-any.whl
  • Upload date:
  • Size: 22.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for django_deploy_probes-0.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d7b0193199316b5be8936c39c9a41324001eac0397a010a228998a554692c5bf
MD5 b0da0ffdc28f2d70edbf5eefb11e6ad7
BLAKE2b-256 cab20676399532fbc702dbcc6fad39112f4669b013d8b6562010099de4e7094d

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.6.0 This release

2 files

0.5.1

2 files

0.5.0

2 files

0.4.0

2 files

0.3.1

2 files

0.3.0

2 files

0.2.1

2 files

0.2.0

2 files

0.1.0

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page