# django-docker
A complete example for deploying Django project with Nginx and MySQL on Docker.
## QuickStart
Install Docker Engine from the tutorial .
Install Docker Compose from the tutorial .
Get the latest project clone to your computer:
```bash
$ git clone https://github.com/huchenw/django-docker.git
```
Run docker-compose commands to start containers:
```bash
$ docker-compose up -d
```
Now you can access the application at or (Docker Toolbox).
## Static Files
To collect static files for nginx to access, just run:
```bash
$ docker-compose exec web bash
$ python manage.py collectstatic
```
## Django Admin
If you want to access django admin site, please apply the django default migrations to database:
```bash
$ docker-compose exec web bash
$ python manage.py migrate
```
Then you need to create a superuser account:
```bash
$ python manage.py createsuperuser
$ ...
```
## Celery Results
Redis is used as broker for Celery .
The official tutorial tells us how to use Celery with Django.
You can check the Celery results from logs:
```bash
$ docker-compose logs celery
```
## Docker Images Reference
| Name | Image |
| ------ | ---------------------------------- |
| Nginx | |
| MySQL | |
| Redis | |
| Python | |