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.3.tar.gz (2.8 kB view details)

Uploaded Source

Built Distribution

django_wait_for_db-1.0.3-py3-none-any.whl (3.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: django_wait_for_db-1.0.3.tar.gz
  • Upload date:
  • Size: 2.8 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.3.tar.gz
Algorithm Hash digest
SHA256 a0f52655339d20909d6e11fabe5f149b4dead2f99e86b9ba3cbb4f6d33ee14db
MD5 3464beb117eb56190562a1c2a6e70bc2
BLAKE2b-256 0120316f00e69a6455ed6e55e9a2bfee653d1edc0c67d4c5d236f68effc288ef

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for django_wait_for_db-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 f0714a0d1ffc671bfbbd9d61f6df5e154ef890e407ff0702cb04e8ab7d4e17a8
MD5 8d11a311efc69cff776742eaa1321c6c
BLAKE2b-256 f5333b1d48b8100ec4f7038991651fc0eb500ce1ab2fd3f74ad88f284202d3dc

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