Metadata-Version: 2.1
Name: django-wait-for-db
Version: 1.0.1
Summary: Simple Django app that provides a simple command to wait for the database to be ready before starting the server.
Home-page: https://github.com/enzofrnt/django_wait_for_db
Author: enzo_frnt
Author-email: contact@enzo-frnt.fr
License: MIT
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Web Environment
Classifier: Framework :: Django
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Topic :: Software Development :: Libraries
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: Django

# 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`:

```python
INSTALLED_APPS = [
    ...
    'wait_for_db',
    ...
]
```

Then run the following command:

```bash
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:

```Dockerfile
FROM python:3.8

(.......)

CMD python manage.py wait_for_db \
    && python manage.py runserver
```
