Skip to main content

Django-probes Latest version on PyPI

GitHub Workflow Status GitHub Workflow Status GitHub Workflow Status Monthly downloads from PyPI Python versions Software license

Provides a Django management command to check whether the primary database is ready to accept connections.

Run this command in a Kubernetes or OpenShift Init Container to make your Django application wait until the database is available (e.g. to run database migrations).

Why Should I Use This App?

wait_for_database is a single command for all database engines Django supports. It automatically checks the database you have configured in your Django project settings. No need to code a specific wait command for Postgres, MariaDB, Oracle, etc., no need to pull a database engine specific container just for running the database readiness check.

Installation

The easiest way to install django-probes is with pip or uv, e.g.

pip install django-probes
uv add django-probes

Basic Usage

  1. Add django-probes to your Django application:

INSTALLED_APPS = [
    ...
    'django_probes',
]

2. Add an Init Container to your Kubernetes/OpenShift deployment configuration, which calls the wait_for_database management command:

- kind: Deployment
  apiVersion: apps/v1
  spec:
    template:
      spec:
        initContainers:
        - name: wait-for-database
          image: my-django-app:latest
          envFrom:
          - secretRef:
              name: django
          command: ['python', 'manage.py', 'wait_for_database']

Use with Your Own Command

Alternatively, you can integrate the wait_for_database command in your own management command, and do things like database migration, load initial data, etc. with roughly the same Kubernetes setup as above.

from django.core.management import call_command

# ...
call_command('wait_for_database')

Command Line Options

The management command comes with sane defaults, which you can override if needed:

–command, -c:

execute Django management command(s) when the database is ready. This option can be used multiple times, e.g. wait_for_database -c 'migrate' -c 'runserver --skip-checks'

–database:

which database of settings.DATABASES to wait for, default: default

–stable, -s:

how long to observe whether connection is stable (seconds), default: 5

–timeout, -t:

how long to wait for the database before timing out (seconds), default: 180

–wait-when-alive, -a:

delay between checks when database is up (seconds), default: 1

–wait-when-down, -d:

delay between checks when database is down (seconds), default: 2

Metadata

Release files for django-probes 1.9.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-probes 1.9.0
File Size Uploaded
django_probes-1.9.0.tar.gz 6.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for django-probes 1.9.0
File Interpreter ABI Platform
django_probes-1.9.0-py3-none-any.whl Python 3 none any Details

Total release size: 12.5 kB

Release files / django_probes-1.9.0.tar.gz

Download URL django_probes-1.9.0.tar.gz
Size 6.2 kB
Tags Source
SHA-256 checksum
How to use checksums
1a7d8243c173b470de7a6251bf3d6a09d7e167ebf02980b4b443ac14bb083242
BLAKE2b-256 checksum
How to use checksums
ed2556fa7367132a7120a43916eb8bde0dc00164337800c527d1bc26782127d7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Release files / django_probes-1.9.0-py3-none-any.whl

Download URL django_probes-1.9.0-py3-none-any.whl
Size 6.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1dda697ac096b08613ff4c538c61cf726d1c8f61f3d5060f320eb4cd2d7719ae
BLAKE2b-256 checksum
How to use checksums
285bf203b305519c7552cc6a77a8d5bb0dee6fdc4a4dced857f14b407b55dcd0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Release history Release notifications | RSS feed

This release

1.9.0 This release

2 release files

1.8.0

2 release files

1.7.0

2 release files

1.6.0

2 release files

1.5.0

2 release files

1.4.0

2 release files

1.3.0

2 release files

1.2.0

2 release files

1.1.0

2 release files

1.0.5

2 release files

1.0.4

1 release file

1.0.3

1 release file

1.0.1

1 release file

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page