A minimal, modern Django 5 base template configured with Docker, PostgreSQL, and uv for dependency management.
- Django 5.0+
- Docker & Docker Compose
- PostgreSQL
- uv for fast dependency management
- Split Settings (Base, Dev, Staging, Production)
- Environment Variables via
.env
Clone this repository and run the initialization script. This script will rename the project, set up the .env file, and generate a secure secret key.
./init_project.sh my_awesome_projectThe script will:
- Rename the
project_namedirectory tomy_awesome_project. - Update all references in
manage.py,wsgi.py,asgi.py, andsettings. - Create
.envfrom.env.example. - Generate a new
DJANGO_SECRET_KEYand update.env. - Set
PROJECT_NAMEandDJANGO_SETTINGS_MODULEin.env.
Build and start the containers:
docker compose up --buildThe application will be available at http://localhost:8000.
This project is configured with internationalization support.
To mark strings for translation in your code, use gettext_lazy:
from django.utils.translation import gettext_lazy as _
class MyModel(models.Model):
name = models.CharField(_("Name"), max_length=100)-
Make Messages: Scans your code for translatable strings and creates/updates
.pofiles.docker compose exec web uv run python manage.py makemessages -l es -
Compile Messages: Compiles
.pofiles into.mofiles for use by Django.docker compose exec web uv run python manage.py compilemessages
Rosetta is installed in the development environment to facilitate translation management.
- Ensure your development server is running.
- Navigate to http://localhost:8000/rosetta/.
- You can edit translations directly from this interface.
This project uses uv to manage dependencies and when running on Docker we use docker compose exec [web container name] to run commands.
-
Add a dependency:
docker compose exec web uv add <package>
-
Sync dependencies:
docker compose exec web uv sync -
Run a command:
docker compose exec web uv run python manage.py migrate