Skip to content

About

This repository contains a pre-configured development environment for Django-based applications, enabling developers to set up a robust development environment with a single command.

Topics

Resources

Security policy

Stars

18 stars

Watchers

1 watching

Forks

Latest commit

Β 

History

37 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Production-Grade Django Starter Kit

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.

Release Stars Forks License: MIT Python Django Docker Celery Elasticsearch YouTube LinkedIn

aws cost (7)


πŸ“‘ Table of Contents


πŸ›οΈ Architecture Overview

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
Loading

🌟 Features

  • 🐳 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 .env templates.

πŸ“‚ Project Directory Layout

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

πŸš€ One-Command Quickstart

1. Clone the repository

git clone https://github.com/codewithmuh/django-starter-kit.git
cd django-starter-kit

2. Configure environment variables

Verify or modify the environment values in build-process/local.backend.env.

3. Spin up all services

docker compose -f "./build-process/docker-compose-django-backend.yml" up -d --build

4. Create an admin user

docker compose -f "./build-process/docker-compose-django-backend.yml" exec web python manage.py createsuperuser

πŸ”Œ Services & Ports Reference

Once 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

πŸ› οΈ Common Development Commands

# 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" down

πŸ‘¨β€πŸ’» Author

Muhammad Rashid β€” Backend & Cloud DevOps Engineer, AWS Community Builder.

⭐ If you find this Starter Kit helpful, please star the repository!


πŸ“„ License

This project is open-source under the MIT License.

About

This repository contains a pre-configured development environment for Django-based applications, enabling developers to set up a robust development environment with a single command.

Topics

Resources

Security policy

Stars

18 stars

Watchers

1 watching

Forks

Releases

Sponsor this project

Packages

Used by

Contributors

Languages