Production Ready

Django Rapido V1.0 REST APIs · Async tasks · Docker

A modern, scalable, and production-ready Django project template. Updated for Django 5.2+ • Python 3.13 • PostgreSQL 17.

Django 5.2+ Python 3.13 PostgreSQL 17 DRF 3.16 Celery 5.6
01

What’s inside

Django Rapido V1.0 is built for speed and long-term maintainability. It comes packed with features like a REST API (DRF 3.16) with JWT, WebSockets via Channels 4.1, background tasks with Celery 5.6, modern admin UI, and a complete Docker setup to take you efficiently from dev to production.

Environment Configuration – Utilizing modular settings via DJANGO_ENVIRONMENT, clean separation of concerns mapping local, production, and testing configs robustly.

Code Quality defaults – Standardized perfectly with Black, isort, Flake8, Mypy, and Pytest shortcuts integrated into Makefile.

REST API

Django REST Framework 3.16 with JWT Authentication (SimpleJWT).

Async & Real‑time

Channel 4.1 WebSockets & Redis. Celery 5.6 for async workers and Celery Beat for cron.

Docker & DevOps

Fully containerized with a smart `entrypoint.sh`, Docker Compose setup, and Nginx reverse proxy.

Frontend & Admin

Modern admin UI designed by Django Unfold. Tailwind CSS natively handled & built via `package.json`.

02

Docker setup (recommended)

Docker Compose provides a seamless development sandbox containing the web application, PostgreSQL, Redis, Celery tasks, and Flower.

bash – Using Docker
# 1. Clone the repository
$ git clone <repository-url> my-project
$ cd my-project

# 2. Copy the environment variables template
$ cp .env.example .env

# 3. Start all services in the background
$ make docker-up

# 4. View logs (if needed)
$ make docker-logs
Access URLs
  • Application: http://localhost:8000
  • Admin Panel: http://localhost:8000/admin
  • API Docs: http://localhost:8000/api/docs/
  • Flower (Celery Dashboard): http://localhost:5555
Local setup (without Docker)
bash – Local Initialization (Using Make)
# 1. Clone the repository
$ git clone <repository-url> my-project
$ cd my-project

# 2. Ensure PostgreSQL and Redis are running locally.
# Update the generated .env file to point DB_HOST and REDIS_HOST to 'localhost'.
$ cp .env.example .env

# 3. Initialize the project 
# (Installs Python & Node.js deps, runs migrations, collects static files, sets up secure keys)
$ make init

# 4. Start the Django development server
$ make run
💡 Tip Both methods rely on the provided Makefile shortcuts to streamline your startup process effortlessly!
03

Tech Stack

ComponentVersionComponentVersion
Python3.13Django5.2+
DRF3.16Channels4.1
Celery5.6PostgreSQL17
Redis7+Docker ComponentsComposer / Engine
Node.jsLatest (For Tailwind)NginxAlpine
04

Project structure

tree – modular configuration tree
project-root/
├── project/                    # Main Django project directory
│   ├── settings/               # Modular settings configuration
│   │   ├── __init__.py         # Environment-aware settings loader
│   │   ├── base.py             # Core settings shared across environments
│   │   ├── local.py            # Development-specific overrides
│   │   ├── production.py       # Production-specific overrides
│   │   ├── testing.py          # Fast, isolated test-specific settings
│   │   └── components/         # Feature-specific modules
│   ├── urls.py                 # Root URL routing
│   ├── asgi.py                 # ASGI entry point
│   └── wsgi.py                 # WSGI entry point
│
├── accounts/                   # Custom User model and authentication
├── common/                     # Utility helpers, base models
├── dashboard/                  # Custom Django Unfold admin adjustments
├── tests/                      # Pytest suite structure
├── guides/                     # Extensive architectural documentation
│
├── docker-compose.yml          # Container orchestration for dev & prod
├── Dockerfile                  # Production-ready Python image
├── entrypoint.sh               # Smart container initialization script
├── nginx.conf                  # Nginx reverse proxy configuration
│
├── static/                     # Global static files
├── media/                      # User-uploaded files
├── logs/                       # Application logs directory
│
├── Makefile                    # Task automation commands
├── requirements.txt            # Python dependencies
├── package.json                # Node.js dependencies
└── .env.example                # Baseline environment configuration
05

Environment & settings

Configuration is entirely managed securely utilizing standard environment variables across all platforms to seamlessly bridge configuration state dynamically.

Environment loading modes
  1. DJANGO_ENVIRONMENT=local (Default): Loads settings/local.py + base.py. Built with DEBUG=True.
  2. DJANGO_ENVIRONMENT=production: Loads settings/production.py. Enforces strict security configurations like HTTPS and DEBUG=False.
  3. DJANGO_ENVIRONMENT=testing: Loads settings/testing.py. Leverages an in-memory SQLite DB for lightning-fast speeds and disables explicit Celery delays.
06

Common commands

Project Lifecycle

make init
make install
make dev
make run
make clean

Database & Shell

make makemigrations
make migrate
make shell

Code Quality & Tests

make format
make lint
make type-check
make test
make test-fast
make test-coverage

Celery Background Tasks

make celery-worker
make celery-beat
make docker-up
07

Make shortcuts

available commands list
make init         # Fully initialize the project setup automatically
make install      # Install Python (requirements.txt) and Node packages
make dev          # Ensure dependencies map directly to a local dev suite
make run          # Start the local Django development server
make clean        # Wipe caching and Python __pycache__ bytecodes

make migrate      # Apply pending database migrations
make makemigrations # Scan models to generate new migrations
make shell        # Bootstrap a Django interactive shell

make format       # Apply formatters (Black & isort)
make lint         # Execute Linters (Flake8)
make type-check   # Boot Static type checking rules (Mypy)
08

Async Tasks via Celery

The project seamlessly handles heavy async computational tasks via Celery and caches using Redis as its robust message broker.

bash – Celery commands
# To run Celery locally without Docker:
# 1. Ensure Redis is relatively available (`redis-server`).
# 2. Boot a Celery Worker daemon:
$ make celery-worker

# 3. Boot the Celery Beat daemon for recurring cron tasks:
$ make celery-beat
📘 Note Using Docker Compose implicitly provides these background daemons natively alongside a `Flower` UI tracker.
09

pytest & test execution

test commands
# Run the core validation test suite
$ make test

# To run specifically against coverage tooling
$ make test-coverage

# Execute with debug fail-fast mode
$ make test-fast
10

Pre‑flight checklist

Verify thoroughly before production deploy

  • DEBUG=False must be strictly toggled within .env.
  • Ensure DJANGO_ENVIRONMENT=production.
  • Run make secret-key to configure a massive randomized hash inside SECRET_KEY.
  • Ensure the domain namespace is exactly configured within ALLOWED_HOSTS.
  • Securely update unassigned generic keys (e.g. DB_PASSWORD, REDIS_PASSWORD, Admin users).
  • Set SECURE_SSL_REDIRECT=True, SESSION_COOKIE_SECURE=True, and CSRF_COOKIE_SECURE=True to encrypt web packets securely.
  • Run python manage.py check --deploy iteratively ensuring all flags vanish before runtime deployment.
11

Production deployment

We use a multi-service container approach orchestrated by docker-compose.yml and natively managed by a resilient entrypoint.sh shell script.

Using Docker Compose (Recommended)
bash – production start
# 1. Initialize and secure the .env for production
#    Set DJANGO_ENVIRONMENT=production & DEBUG=False.
#    Run `make secret-key` locally to spawn a secure hash and apply it natively.

# 2. Compose and deploy with built images securely
$ make docker-build
$ make docker-up

# Applications securely available natively via Nginx mapped directly on reverse proxy
Manual deployment (without Docker)
bash – gunicorn
# 1. Gather static files payload mapping natively to application storage volumes route bounds securely
$ python manage.py collectstatic --noinput

# 2. Push database schema migrations natively across production SQL databases uniformly
$ python manage.py migrate

# 3. Spin up Gunicorn bound securely routing locally on server box natively handling heavy lifting explicitly properly directly dynamically correctly exclusively efficiently accurately globally globally efficiently correctly seamlessly safely cleanly cleanly globally natively seamlessly
$ gunicorn project.wsgi:application \
    --bind 0.0.0.0:8000 \
    --workers 4 \
    --worker-class sync \
    --max-requests 1000 \
    --timeout 120
12

Docker Roles & Layers

ServiceConfiguration ContextRouting Port Assignment Context
dbPostgres 17 Engine Native Setup Structure5432
redisRedis Cache broker message dispatcher configuration scope route logic backend schema core6379
webPython 3.13 Gunicorn App Core Module Logic Process Unit Environment Instance Structure Block Component Interface API RESTful Application Subsystem Routine Thread Space Frame Execution Routine Flow Model Controller Route Setup Controller Setup Thread8000
celery_workerBackground Worker Logic Process Space Routine Component Logic Native Integration Node Node Instance
celery_beatCron Engine Task Runner Daemon Processing Component System Engine Block Context Frame
flowerDashboard Performance Tracker UI System Process View5555
nginxReverse Proxy Web Engine Load Balancer HTTP Node Layer Server Front Edge Traffic Gateway Gateway Endpoint Edge Block Gateway Endpoint Route Logic Load Logic Traffic Endpoint Server Edge Front Instance Service Subsystem Route Interface80, 443
📘 Note The underlying entrypoint.sh natively resolves dependencies gracefully, awaiting securely for database nodes prior gracefully booting Django instance contexts and performing initial migration logic routing inherently correctly safely smoothly statically reliably dynamically correctly robustly exclusively explicitly accurately uniquely uniformly reliably securely.