A minimal Django project template with modern tooling and best practices.
- Django 5.0+ with Django REST Framework
- PostgreSQL database configuration
- Docker Compose setup with postgres:alpine
- Environment-based configuration with python-dotenv
- Comprehensive logging system (console + file)
- Code formatting and linting with Ruff
- Pre-commit hooks
- UV package manager
-
Copy the env.example file to .env and update values:
cp env.example .env
-
Install dependencies with UV:
uv pip install -e . uv pip install -e ".[dev]"
-
Run with Docker Compose:
docker-compose up -d
-
Or run locally (ensure PostgreSQL is running):
cd app python manage.py migrate python manage.py runserver -
Install pre-commit hooks (optional):
pre-commit install
base-django/
├── app/ # Django application code
│ ├── core/ # Django project settings and configuration
│ ├── templates/ # Django templates
│ ├── static/ # Static files
│ ├── media/ # User uploaded files
│ └── manage.py # Django management script
├── logs/ # Application logs
├── docker-compose.yml # Docker services configuration
├── Dockerfile # Container definition
├── pyproject.toml # Dependencies and tool configuration
├── .env # Environment variables
└── README.md # Documentation
- Format code:
ruff format . - Lint code:
ruff check . - Run migrations:
cd app && python manage.py migrate - Create superuser:
cd app && python manage.py createsuperuser
- Admin: http://localhost:8000/admin/
- API Root: http://localhost:8000/api/