Skip to content

Fast Django

A production-ready Django + FastAPI + Celery template with dependency injection, type safety, and modern Python practices.

Why Fast Django?

This template provides a solid foundation for building scalable Python applications by combining:

  • Django for ORM, admin panel, and authentication
  • FastAPI for high-performance REST APIs
  • Celery for background task processing
  • punq for dependency injection
  • Pydantic for validation and settings management
  • Logfire for observability (OpenTelemetry-based)

Key Features

  • Service Layer Architecture: Clean separation between HTTP controllers and database operations
  • Auto-Registration IoC: Minimal boilerplate dependency injection with automatic wiring
  • Type Safety: Full mypy --strict compatibility with Python 3.14+
  • Test Isolation: Per-test container instances with easy mocking
  • Unified Controller Pattern: Same pattern for HTTP endpoints and Celery tasks

The Golden Rule

This template enforces a strict architectural boundary:

Controller → Service → Model

✅ Controller imports Service
✅ Service imports Model
❌ Controller imports Model (NEVER)

Controllers handle HTTP/Celery concerns. Services contain business logic and database operations. Models define data structures.

Requirements

  • Python 3.14+
  • Docker and Docker Compose
  • uv (Python package manager)

Getting Help