Skip to main content

Simple Django app that provides a simple command to wait for the database to be ready before starting the server.

Project description

django_wait_for_db

Django app that provides a simple command to wait for the database to be ready before starting the server.

Installation

Install the package using pip:

pip install django_wait_for_db

Usage

Add django_wait_for_db to your INSTALLED_APPS:

INSTALLED_APPS = [
    ...
    'wait_for_db',
    ...
]

Then run the following command:

python manage.py wait_for_db

This will wait for the database to be ready before starting the server. This is useful when you are using Docker and you want to start the Django server before the database is ready or when you are in an environment where the database is not always available when the Django server starts.

Exemple of a Dockerfile:

FROM python:3.8

(.......)

CMD python manage.py wait_for_db \
    && python manage.py runserver

Project details


Download files

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

Source Distribution

django_wait_for_db-1.0.4.tar.gz (4.1 kB view details)

Uploaded Source

Built Distribution

django_wait_for_db-1.0.4-py3-none-any.whl (5.7 kB view details)

Uploaded Python 3

File details

Details for the file django_wait_for_db-1.0.4.tar.gz.

File metadata

  • Download URL: django_wait_for_db-1.0.4.tar.gz
  • Upload date:
  • Size: 4.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.5 Linux/6.5.0-1025-azure

File hashes

Hashes for django_wait_for_db-1.0.4.tar.gz
Algorithm Hash digest
SHA256 0ed4da979bc909e2895359e9f45ee5da7bab9a92d9eb88dac2a3e9d1ebf1816b
MD5 d26de30b1b75425603570fa0bf86f6d6
BLAKE2b-256 99fdfbc75e1355a6450b346b4366282a6691164a7bf2c715deb03ccc417f303f

See more details on using hashes here.

File details

Details for the file django_wait_for_db-1.0.4-py3-none-any.whl.

File metadata

File hashes

Hashes for django_wait_for_db-1.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 c1321c133b7177ab391102f0bde7bcf470ecbe7830d72ecfda97376a81908a63
MD5 fbe6942341a93ea42e3f91a1a8aa4329
BLAKE2b-256 03e0c7c0344e5916b27e450d57d3cdfe5a8437dd7df68540c2a680381ac43b43

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page