Django startproject template with batteries and nice tooling.
I took the inspiration from Jeff Triplett's django-startproject and created my own starter for a fresh django project. It includes the batteries I use regularly. 🤷♂️
The template is also inspired by Carlton Gibson's Post The Single Folder Django Project Layout. It uses
the single folder layout as a start as I always run in the same situation Carlton describes in his post. If
you have to split the project into several apps, you can always call python manage.py startapp
later on.
Out of the box SQLite is configured, but you can easily activate MySQL or Postgres support.
- Python 3.13
- Django 5.1.x
- django-htmx
- django-tailwind-cli
- django-typer
- environs[django]
- heroicons
- whitenoise
- Optimzed SQLite settings
- Argon2 password hashing
- uses the single folder Django project layout
- adds some standard templatetags to the builtins
- A local install of htmx.
- BaseCommand class for writing management commands that log to a rotating logfile and the console if run
in an interactive shell. See
webapp/management/commands/base.py
.
- django-stubs
- django-browser-reload
- django-test-plus, model-bakery & faker
- pre-commit setup inspired by Boost your Django DX
- sane ruff configuration
- poetry for dependency management
- just for project management and maintenance
$ django-admin startproject \
--extension=py,toml,sh \
--template=https://github.com/oliverandrich/django-startproject/archive/main.zip \
example_project
# Setup environment and install dependencies
$ just bootstrap
# Migrate database
$ just migrate
# Start dev server
$ just runserver
# Bootstrap the project and install dependencies
just bootstrap
# Upgrade/install all dependencies defined in pyproject.toml
just upgrade
# Run database migrations
just migrate
# Create database migrations
just makemigrations
# Start debugserver
just runserver
# or
just debugserver
# Start the interactive django shell
just shell
# Start manage.py for all cases not covered by other commands
just manage ...
# Run pre-commit rules on all files
just lint
# Run test suite
just test
# run test suite with code coverage analysis
just coverage
Or when run as a 12-Factor application.
Environment Variable | Default | Location |
---|---|---|
ALLOWED_HOSTS | [] | settings.py |
CACHE_URL | "locmem://" | settings.py |
CSRF_TRUSTED_ORIGINS | [] | settings.py |
DATABASE_URL | "sqlite:///db.sqlite3" | settings.py |
DEBUG | False | settings.py |
EMAIL_URL | "console:" | settings.py |
INTERNAL_IPS | [] | settings.py |
LANGUAGE_CODE | "EN" | settings.py |
SECRET_KEY | settings.py | |
TAILWIND_CLI_PATH | "~/.local/bin" | settings.py |
TIME_ZONE | "UTC" | settings.py |
GRANIAN_WORKERS | 1 | entrypoint.sh |
GRANIAN_THREADS | 1 | entrypoint.sh |
GRANIAN_* | see https://github.com/emmett-framework/granian | entrypoint.sh |
The docker/Dockerfile
uses a multi stage process to embrace caching for building the container images.
Contributions, issues and feature requests are welcome! Feel free to check issues page.