Skip to main content

Command Palette

Search for a command to run...

🚀 Build Production-Ready Django APIs in Minutes — My Django Starter Template

Published
4 min read
🚀 Build Production-Ready Django APIs in Minutes — My Django Starter Template
S

Hi, I’m Shankar — a Sr. Software Engineer specializing in Python, Django, and DevOps. I build scalable web applications, APIs, and cloud-native systems, with a focus on clean architecture and backend automation.

🧭 Why I Built This Starter Template

Every time I started a new Django project, I found myself repeating the same boilerplate setup:

  • Configuring JWT authentication

  • Wiring Celery for async jobs

  • Adding Docker for deployment

  • Managing environment-specific settings

  • And finally debugging social login or email sending for days 🙃

So I decided to fix that once and for all — by building a Django starter that’s not just a skeleton, but a production-ready, API-first foundation.

This starter is designed for developers who want to ship faster without compromising structure, scalability, or security.

⚡️ What Makes It Different

Here’s what’s baked in out of the box:

  • 🧩 Layered Architecture — Modular settings (local, production, base), versioned APIs under /api/v1/, and reusable base apps.

  • 🔐 JWT + Social Auth — Email-first custom user model, SimpleJWT integration, and Google OAuth support (via allauth).

  • 📬 Async Tasks + Scheduling — Celery with Redis configured as both broker and backend, including Celery Beat for periodic jobs.

  • 🧠 Observability Ready — Sentry integration, structured logging, /ping and /iconfig health endpoints.

  • 🪶 Developer Experience — uv for dependency management, runserver_plus auto-reload, debug-toolbar, and formatting scripts.

  • 🧰 Rich Text & Media — CKEditor 5 integration with authenticated uploads and automatic URL rewriting for production.

In short, it’s a modern Django stack that feels like a small engineering team already set it up for you.

🧱 Project Structure

backend/
├── core/       # Global settings, Celery app, JWT config, URLs
├── base/       # Mixins, pagination, Config model, health views
├── users/      # Custom user, serializers, viewsets, admin customizations
├── static/     # Static files
├── templates/  # Global templates (emails, admin, etc.)
compose/
├── local/      # Docker setup for local dev (watchmedo, runserver_plus)
└── production/ # Dockerfiles for Gunicorn, Nginx, Celery
envs/           # Environment variable templates
local.yml       # Docker Compose for local development
production.yml  # Docker Compose for production deployment

The goal is to make every environment reproducible — your local stack should feel identical to production.

🧪 Built for Developers Who Want Velocity

Whether you’re building:

  • A SaaS backend

  • An internal dashboard API

  • A data processing app with Celery tasks

  • Or even a teaching/demo project

This starter gives you a clean foundation with all the “boring setup” already done.

You just write your business logic.

🐳 Local Setup in 2 Commands

docker compose -f local.yml up --build
docker compose -f local.yml run --rm django uv run manage.py migrate

Then visit:

👉 http://localhost:8000

Admin panel lives at /admin/, and your API docs (Swagger UI) are ready at /api/v1/docs/.

🧩 Auth API Highlights

EndpointDescription
POST /api/v1/users/login/Email-password login returning JWT pair
POST /api/v1/users/otp-request/Triggers an email OTP via Celery
POST /api/v1/users/token/refresh/Refresh access tokens
POST /api/v1/users/logout/Blacklists refresh tokens
POST /api/v1/google-login/Google OAuth ready (once credentials configured)

🧰 Observability and Production Readiness

The stack includes:

  • Sentry SDK (just set your DSN)

  • Log rotation inside /logs

  • Redis caching

  • Health endpoints for load balancers

  • Docker Compose production setup with Gunicorn + Nginx

You can literally push this stack to any VPS or AWS ECS environment and it’ll run cleanly.

💡 Developer Experience

You get prebuilt helpers for:

# format and lint
docker compose -f local.yml run --rm django uv run black .

# run coverage report
docker compose -f local.yml run --rm django uv run coverage run manage.py test
docker compose -f local.yml run --rm django uv run coverage html

A few minutes after cloning, you’re already productive.

🎯 Why This Matters

This isn’t just a “starter project.”

It’s a mental model for how to structure modern Django APIs — with async support, JWTs, CI/CD safety, and observability built in.

If you’ve ever wasted a week configuring Celery or Docker networking, you’ll appreciate the defaults here.

🌐 Get Started

👉 GitHub Repository: django-starter

⭐ Star it if you find it useful — it helps more developers discover it!

Clone and start coding:

git clone [email protected]:shankarlmc/django_starter.git
cd django_starter
docker compose -f local.yml up --build

💬 Final Thoughts

This Django starter is not about showing off complexity — it’s about removing friction for solo devs and small teams.

You get a setup that scales, debugs easily, and runs async jobs from day one.

“Build smarter, not slower — start with a solid foundation and ship with confidence.”

More from this blog