Production-ready HTMX starter with Python, Django, and PostgreSQL. One-click deploy to Railway.
Minimal Django project (no admin app in INSTALLED_APPS) focused on a Todo demo. DATABASE_URL is required and parsed with dj-database-url (SSL for non-local hosts). URLs use trailing slashes; health is GET /health/. CSRF works with HTMX via csrf_token on the form and htmx:configRequest reading data-csrf on <body>.
- Railway PostgreSQL
DATABASE_URL=${{Postgres.DATABASE_URL}}
| Layer | Technology | Role |
|---|---|---|
| Frontend | HTMX + Tailwind (CDN) | Partial updates |
| Templating | Django templates | Views + includes |
| Database | PostgreSQL | Todo model |
- Add PostgreSQL + web service (Dockerfile)
- Set
DATABASE_URL - Optional:
DJANGO_SECRET_KEY(random string) - Railway health check path:
/health/(note trailing slash)
pip install -r requirements.txt
export DATABASE_URL="postgres://user:pass@localhost:5432/db"
python manage.py migrate
python manage.py runserver 0.0.0.0:8080| Variable | Required | Default | Description |
|---|---|---|---|
DATABASE_URL |
Yes | - | PostgreSQL URL |
DJANGO_SECRET_KEY |
No | Dev default | Set in production |
PORT |
No | 8080 |
Gunicorn bind port in Docker |
This is one of 15 HTMX starter templates covering different backend stacks, all following the same pattern and ready for Railway deployment:
| Stack | Status |
|---|---|
| Bun + Elysia | Coming soon |
| .NET + Razor | Coming soon |
| Elixir + Phoenix | Coming soon |
| Go + Chi | Live |
| Go + Echo | Live |
| Go + Fiber | Live |
| Java + Spring Boot (MySQL) | Live |
| Java + Spring Boot (PostgreSQL) | Live |
| Node + Express | Live |
| Node + Hono | Live |
| PHP + Laravel | Live |
| Python + Django | This repo |
| Python + FastAPI | Live |
| Ruby + Rails 8 | Live |
| Rust + Axum + Askama | Live |
Built by AToolZ for the HTMX community
