Skip to content

Repository files navigation

Ultimate Django Starter Kit

Python Django PostgreSQL Redis Docker TailwindCSS uv

Production-ready Django 6.x starter template featuring Docker Compose, Postgres, Redis, Celery, and TailwindCSS integrated with DaisyUI.

Tech Stack

  • Core: Python 3.14, Django 6.x
  • Database & Cache: PostgreSQL 18, Redis 8
  • Infrastructure: Docker Compose, Gunicorn + Nginx
  • Frontend: TailwindCSS, DaisyUI
  • Tooling: uv (package management), pytest, ruff, mypy
  • CI/CD: GitHub Actions, strict local/prod environment split (django-environ)

Features

  • Strict Environment Separation: Isolated logic for Local and Production.
  • Flawless Docker: No root permission conflicts on Linux/Mac. uv for blazing-fast package management.
  • Fail-Fast Security: Production server refuses to start if .env is misconfigured.
  • Nginx & HTTPS Ready: Self-contained proxy, static files cache busting, and easy Certbot renewal.
  • Tailwind Hot-Reload: Native integration inside the local container, without messy local dependencies.

💻 Local Development

  1. Clone the repository:
git clone git@github.com:ivanitch/django-starter.git django-project
cd django-project
  1. Setup environment variables:
cp .env.example .env
  1. Start the project using Makefile:
make up

This builds images, starts the database, and launches Django + Tailwind watcher.

  1. Apply migrations and create a superuser::
make migrate
make bash
# Inside container:
python manage.py createsuperuser
  1. View local Logs:
make logs

make logs db

App runs at: http://localhost:8000


🌍 Production Deployment (VPS)

Production operates in strict isolation. It does not rely on the local docker-compose.yml. Node.js and dev packages are stripped from the final image.

  1. Clone to your VPS:
git clone git@github.com:ivanitch/django-starter.git django-project
cd django-project
  1. Configure Production Settings:
cp .env.prod.example .env.prod
nano .env.prod

Make sure to generate a secure SECRET_KEY, set DEBUG=False, update ALLOWED_HOSTS, and set the exact URL in CSRF_TRUSTED_ORIGINS. Add your domains (DOMAIN, WWW_DOMAIN), CERTBOT_EMAIL, configure PostgreSQL credentials ( POSTGRES_DB, POSTGRES_USER, POSTGRES_PASSWORD), and set up your SMTP email variables.

  1. 🔒 SSL via Certbot (First Time Setup):
make prod-init-ssl

This command will build the prod image, apply migrations, run collectstatic into the Docker volume, and safely restart the web and nginx containers

  1. Deploy (Zero Downtime)
make prod-deploy

This command will build the prod image, apply migrations, run collectstatic into the Docker volume, and safely restart the web and nginx containers.

  1. View Production Logs:
make prod-logs

CI/CD Setup (GitHub Actions)

Detailed information on CI/CD settings

Detailed deployment instructions for production


Additional

About

Production-ready Django 6.x starter template featuring Docker Compose, Postgres, Redis, Celery, and TailwindCSS integrated with DaisyUI.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages