A Django REST API backend template with Docker and PostgreSQL.
- Python 3.14
- Django 6.0
- Django REST Framework
- PostgreSQL 17
- UV (package manager)
- Docker
├── config/ # Django project
│ ├── config/ # Settings, URLs, WSGI/ASGI
│ ├── apps/ # Django applications
│ └── assets/ # Static and media files
├── Dockerfile
├── docker-compose.yml
├── pyproject.toml
└── justfile
-
Clone and remove existing git history:
git clone https://github.com/Moataz0000/mezo_backend_temp cd my-project rm -rf .git git init git add . git commit -m "Initial commit"
-
Create the environment file by copying the template, then edit the values:
cp config/dummy.env config/.env
See Environment Variables for what each value means.
-
Build and run:
docker-compose up --build
-
Access at
http://localhost:8000
| Command | Description |
|---|---|
just run |
Start development server |
just migrate |
Run database migrations |
just makemigrations |
Create new migrations |
just createapp <name> |
Create a new Django app |
just createadmin |
Create an admin user |
just shell |
Open Django shell |
just test |
Run tests |
just up |
Start Docker containers |
just up-build |
Build and start Docker |
just down |
Stop Docker containers |
just logs |
View Docker logs |
| Variable | Description |
|---|---|
DJANGO_SECRET_KEY |
Django secret key |
DJANGO_SUPERUSER_EMAIL |
Admin user email |
DJANGO_SUPERUSER_PASSWORD |
Admin user password |
POSTGRES_DB |
Database name |
POSTGRES_USER |
Database user |
POSTGRES_PASSWORD |
Database password |
DB_HOST |
Database host |
DB_PORT |
Database port |
- Django 6.0 + Django REST Framework
- PostgreSQL 17 database
- Docker & Docker Compose setup
- UV package manager (fast & modern)
- Pre-commit hooks for code quality
- Actions to check the PRs
- Just commands for common tasks
- Custom User model (Flixable)
- Background Tasks
- Assets & template configurations
- Debugging Toolbar