A production-ready Django template with a senior-level architecture, designed for teams that need to ship fast without compromising on quality. This template provides a solid foundation for building scalable and maintainable web applications.
- Production-Ready Architecture: Built with a
src/layout, modular settings, and a clean, scalable structure. - API-First Design: Comes with Django REST Framework and
drf-spectacularfor automatic OpenAPI documentation. - Advanced Database Models: Includes abstract base models for timestamps, soft deletion, and audit trails.
- Comprehensive Testing Suite:
pytestsetup with high coverage, including tests for API, services, and repositories. - Robust Security: Pre-configured with security headers, JWT authentication, rate limiting, and vulnerability scanning.
- Mature DevOps: Multi-stage Docker builds, a full CI/CD pipeline with GitHub Actions, and health checks for all services.
- Developer Productivity: A
Makefilewith commands for common tasks, from running tests to managing migrations.
| Component | Technology | Purpose |
|---|---|---|
| Framework | Django 5.2 | Web Framework |
| API | Django REST Framework | API Development & OpenAPI Docs |
| Database | PostgreSQL 15+ | Primary Database |
| Cache & Message Broker | Redis 7+ | Caching & Background Task Queues |
| Async Tasks | Celery 5.5 | Background Task Processing |
| Testing | Pytest | Test Framework |
| Linting & Formatting | Ruff | Code Quality & Style |
| Type Checking | MyPy | Static Type Analysis |
| Security Scanning | Bandit + Safety | Vulnerability Scanning |
| Error Tracking | Sentry | Real-time Error Monitoring |
This project is a template. To start your own project from it, follow these steps.
Click the "Use this template" button at the top of this page to create a new repository under your own account. Do not fork this repository.
Once your repository is created, clone it to your local machine, replacing your-username and your-new-project with your details.
git clone https://github.com/your-username/your-new-project.git
cd your-new-project
This single command builds the Docker images, starts the containers, creates the .env file from the example, and runs the initial database migrations.
make setup
After the setup is complete, review and customize the newly created .env file.
make superuser
Your new project's development environment is now running.
- API Documentation: http://127.0.0.1:8000/api/docs/
- Admin Interface: http://127.0.0.1:8000/admin/
- Health Check: http://127.0.0.1:8000/health/
A Makefile is included to simplify common development tasks.
| Command | Description |
|---|---|
make setup |
Runs the initial setup to build and start the environment. |
make up |
Starts all Docker services in the background. |
make down |
Stops all Docker services. |
make restart |
Restarts all services. |
make logs |
View real-time logs from all services. |
make shell |
Open a bash shell inside the Django container. |
make test |
Run the complete test suite with coverage. |
make quality |
Run all quality checks (lint, format, tests). |
make migrate |
Apply database migrations. |
make migrations |
Create new migration files based on model changes. |
make superuser |
Create an admin user. |
make help |
Shows a list of all available commands. |
src/
├── apps/ # Application-specific business logic
│ └── core/ # A core app with shared models and functionality
├── config/ # Project configuration
│ ├── settings/ # Modular settings (base, development, production)
│ ├── urls.py # Main URL configuration
│ └── celery.py # Celery configuration
├── static/ # Static assets
├── templates/ # Django templates
└── scripts/ # Utility and automation scripts
This template is a source-available project designed to showcase a production-ready, enterprise-grade architecture. The source code is publicly visible for portfolio review and educational purposes.
It is under a proprietary license. You may view, fork, and learn from the code, but you are not permitted to use it as a foundation for your own projects without explicit written permission. For licensing inquiries, please contact the author.