A batteries-included, modular boilerplate and development environment for Django 4.2+ and Django REST Framework (DRF). Pre-configured with Docker Compose, PostgreSQL, Elasticsearch, Celery (asynchronous workers + scheduler), and Swagger / OpenAPI interactive documentation.
- Architecture Overview
- Key Features
- Project Directory Layout
- One-Command Quickstart
- Environment Configuration
- Services & Ports Reference
- Common Development Commands
- Author & Community
- License
flowchart TD
Client([Client / Frontend / Browser]) -->|HTTP :8000| Django[Django REST API Core]
Django -->|Docs / API Schema| Swagger[Swagger / OpenAPI UI]
Django -->|Relational Data| Postgres[(PostgreSQL Database)]
Django -->|Full-Text Search| ES[(Elasticsearch Engine)]
Django -->|Dispatch Async Job| Broker[(Redis / RabbitMQ Broker)]
Broker --> Worker[Celery Worker]
Beat[Celery Beat Scheduler] --> Broker
Worker --> Postgres
- π³ One-Command Docker Setup: No need to install and configure Python, PostgreSQL, Redis, or Elasticsearch manually.
- β‘ Asynchronous Task Processing: Pre-wired Celery workers and Celery Beat periodic task scheduler.
- π Full-Text Search Engine: Integrated Elasticsearch service ready for search indexing and fast queries.
- π Self-Documenting REST APIs: Interactive Swagger / OpenAPI documentation at
/api/docs/. - ποΈ Production PostgreSQL: Resilient relational database layer pre-configured with volume persistence.
- π‘οΈ Secure Secret Management: Clean environment segregation using
.envtemplates.
django-starter-kit/
βββ backend/ # Django project source code
β βββ apps/ # Modular Django apps
β βββ config/ # Core settings (base, dev, prod), WSGI, ASGI
β βββ manage.py # Management script
βββ build-process/ # Docker orchestration assets
β βββ docker-compose-django-backend.yml
β βββ Dockerfile
β βββ local.backend.env # Development environment variables
βββ requirements/ # Split Python dependencies
β βββ base.txt
β βββ local.txt
β βββ production.txt
βββ README.md
git clone https://github.com/codewithmuh/django-starter-kit.git
cd django-starter-kitVerify or modify the environment values in build-process/local.backend.env.
docker compose -f "./build-process/docker-compose-django-backend.yml" up -d --builddocker compose -f "./build-process/docker-compose-django-backend.yml" exec web python manage.py createsuperuserOnce running, access the local services via these ports:
| Service | Port | Description |
|---|---|---|
| Django Backend API | http://localhost:8000/ |
Main application server |
| Swagger / OpenAPI Docs | http://localhost:8000/api/docs/ |
Interactive API sandbox & schema |
| Django Admin | http://localhost:8000/admin/ |
Management and database administration |
| PostgreSQL | localhost:5432 |
Relational database connection |
| Elasticsearch | localhost:9200 |
Search engine HTTP REST interface |
# View real-time container logs
docker compose -f "./build-process/docker-compose-django-backend.yml" logs -f web
# Run database migrations inside container
docker compose -f "./build-process/docker-compose-django-backend.yml" exec web python manage.py migrate
# Stop all background services
docker compose -f "./build-process/docker-compose-django-backend.yml" downMuhammad Rashid β Backend & Cloud DevOps Engineer, AWS Community Builder.
- π₯ YouTube: @codewithmuh
- πΌ LinkedIn: Muhammad Rashid
- π Website: codewithmuh.com Β· devopsbymuh.com
β If you find this Starter Kit helpful, please star the repository!
This project is open-source under the MIT License.
