# django-docker **Repository Path**: huchenw/django-docker ## Basic Information - **Project Name**: django-docker - **Description**: django的docker部署实例,希望大家喜欢 - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 3 - **Forks**: 0 - **Created**: 2018-05-24 - **Last Updated**: 2021-01-18 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # 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 | |