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
Built Distribution
File details
Details for the file django_wait_for_db-1.0.6.tar.gz
.
File metadata
- Download URL: django_wait_for_db-1.0.6.tar.gz
- Upload date:
- Size: 5.2 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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 64ba37b857e2285da1e7b11b7ab5bc12e57a943420bdc210a8eb414249779fa6 |
|
MD5 | 35cea03a62b5ecde02ce09ffe8a6ec37 |
|
BLAKE2b-256 | ad8dae409b48f52cbf7224d7464a832b5de7855bb14cdd196b9b588faa150e06 |
File details
Details for the file django_wait_for_db-1.0.6-py3-none-any.whl
.
File metadata
- Download URL: django_wait_for_db-1.0.6-py3-none-any.whl
- Upload date:
- Size: 5.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.12.5 Linux/6.5.0-1025-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c071fe0861c5469de6874d38adf779df10a2d42acd3a31a70eef003c751360c2 |
|
MD5 | 9b3f65fbe0cb7ac648caab7fb36517e4 |
|
BLAKE2b-256 | 70550968d0e3c187084c4b56ee8d765e98a499684202b277c26e2fd5195bd406 |