A complete, production-ready Django project boilerplate using Docker Compose. Everything you need to go from zero to a fully running Django stack — database, async tasks, monitoring, reverse proxy, and caching — all in a single docker-compose up.
⭐ Use this as a starting point for your own Django projects.
| Service | Technology | Purpose |
|---|---|---|
| Web App | Django 5 + uWSGI | WSGI application server |
| Reverse Proxy | Nginx | Routes traffic, caches static/media files |
| Database | PostgreSQL | Primary relational database |
| DB Admin | pgAdmin 4 | PostgreSQL browser-based GUI |
| Cache / Broker | Redis | Celery message broker + Django cache |
| Task Queue | Celery | Async background task processing |
| Scheduler | Celery Beat | Periodic/scheduled task runner |
| Task Monitor | Flower | Real-time Celery monitoring dashboard |
| Metrics | Prometheus Client | App metrics collection |
Django-project-setup/
├── app/ # Django application code
├── proxy/ # Nginx configuration (reverse proxy + static caching)
├── scripts/ # Entrypoint and helper shell scripts
├── Dockerfile # Django + uWSGI image
├── docker-compose.yml
├── requirements.txt
├── .env # Environment variables
└── .dockerignore
- Docker (v20+)
- Docker Compose (v2+)
git clone https://github.com/LokRaj-Vuppu/Django-project-setup.git
cd Django-project-setupEdit the .env file with your settings:
SECRET_KEY=your_django_secret_key
DEBUG=False
POSTGRES_DB=django_db
POSTGRES_USER=postgres
POSTGRES_PASSWORD=password
POSTGRES_HOST=db
POSTGRES_PORT=5432
REDIS_URL=redis://redis:6379/0
CELERY_BROKER_URL=redis://redis:6379/0
CELERY_RESULT_BACKEND=django-db
PGADMIN_DEFAULT_EMAIL=admin@admin.com
PGADMIN_DEFAULT_PASSWORD=admindocker compose build
docker compose upOr run in detached mode:
docker compose up -ddocker compose exec web python manage.py migratedocker compose exec web python manage.py createsuperuserdocker compose exec web python manage.py collectstatic --no-input| Service | URL |
|---|---|
| Django App | http://localhost |
| pgAdmin | http://localhost:5050 |
| Flower (Celery Monitor) | http://localhost:5555 |
Client Request
│
▼
Nginx (port 80)
│ ├── /static/ → serves cached static files directly
│ └── /media/ → serves cached media files directly
│
▼
uWSGI (Django WSGI)
│
├──► PostgreSQL (psycopg2)
├──► Redis (cache + Celery broker)
│
▼
Celery Worker ◄──── Redis Broker
│
Celery Beat (Periodic Scheduler)
│
Flower (Monitoring UI)
# View logs for a specific service
docker compose logs -f web
docker compose logs -f celery
# Run Celery worker manually
docker compose exec web celery -A app worker -l info
# Run Celery Beat manually
docker compose exec web celery -A app beat -l info
# Stop all services and remove volumes
docker compose down -v
# Rebuild after code changes
docker compose up --buildThis repo uses uWSGI as the WSGI server (instead of Gunicorn) and is designed for Docker Compose deployment only. For a Kubernetes-based setup with the same stack, see django-kubernetes.
LokRaj Vuppu — GitHub