Skip to content

CFBruna/django-enterprise-template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Django Enterprise Template

CI Python 3.12 Django 5.2 Code style: ruff Coverage

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.


✨ Features

  • 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-spectacular for automatic OpenAPI documentation.
  • Advanced Database Models: Includes abstract base models for timestamps, soft deletion, and audit trails.
  • Comprehensive Testing Suite: pytest setup 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 Makefile with commands for common tasks, from running tests to managing migrations.

🛠️ Tech Stack

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

🚀 Getting Started

This project is a template. To start your own project from it, follow these steps.

1. Create Your Repository

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.

2. Clone Your New 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

3. Run the Initial Setup

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.

4. Create a Superuser

make superuser

5. You're Ready!

Your new project's development environment is now running.


⚙️ Makefile Commands

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.

📂 Project Structure

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

⚖️ Purpose & Licensing

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.

About

A production-ready Django template for building scalable and maintainable web applications with an enterprise-grade architecture.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors