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

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: django_wait_for_db-1.0.2.tar.gz
  • Upload date:
  • Size: 3.2 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.2.tar.gz
Algorithm Hash digest
SHA256 892cc4c2d8a2918dc9e66b2d2c7a6bf87923eb3e39777aa13cb85b28c5a969dd
MD5 de8c853d594841b6cde3f635c6bf94ad
BLAKE2b-256 4f1409b91a538288d7468786b8fc83def89d7c9babf286210832043493774d7a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for django_wait_for_db-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 14bdb7893076a23788507e2d30782f17317a9efcfba6827797eabf902377e8b5
MD5 c543ed35f87a53c08b778c54dd5c73d9
BLAKE2b-256 3b190a9b304bb958aef54bba248e0ef9029d44827ef4222f39a6caa17b10eb4b

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