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.

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

Uploaded Source

Built Distribution

django_wait_for_db-1.0.1-py3-none-any.whl (3.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: django_wait_for_db-1.0.1.tar.gz
  • Upload date:
  • Size: 3.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.19

File hashes

Hashes for django_wait_for_db-1.0.1.tar.gz
Algorithm Hash digest
SHA256 cd9bb0a5751e4909a39ecebb69a1940e695e8484181e7ae0cfe535bba8ce3771
MD5 fd2253b5fdecd0915821031f1e839072
BLAKE2b-256 dbbb2c18f704c963fb5521ba46b721dde94a7946dc1ee6bc8b015bea22ea3b14

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for django_wait_for_db-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 dc7acd5d074e4acc182a73ae3df372926965127b2c1ec33443a66c6f0c665e94
MD5 6f46a486ed469106ce775deb45c5d471
BLAKE2b-256 30bdd6dc8bd4244a387bc54a5b1f7bf0a0402f4a311a5770eef693f868c3a436

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