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

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: django_wait_for_db-1.0.5.tar.gz
  • Upload date:
  • Size: 5.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.5.tar.gz
Algorithm Hash digest
SHA256 6f82fea993e4bcfc275910d9c456b9aa4a7ccca201e976e5bdbb4a70053a077e
MD5 ffdbe2d3ced4976488913f31c4f559eb
BLAKE2b-256 f050265e5065b6ea78e2f0f62d88b38760359023fddd92c2be31697d75e13e64

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for django_wait_for_db-1.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 642b896c627aa558590915edccb06b074f555a24f308ea9f4908d420b1a17be4
MD5 6c0f41a55ab7669efeb649cd2f0af940
BLAKE2b-256 b26da8bc2975eb3588519f441c11c08e4979a78f119f9832a3b1e7bc79fd881b

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