A production‑ready starter kit for modern Django applications.
Photo by James Kovin on Unsplash
Overview
Copier template for Django projects with HTMX, Alpine.js, and Tailwind CSS.
This project is designed to be a starting point for building modern Django applications with a focus on simplicity, performance, and developer experience. It includes an opinionated and carefully curated stack of tools and libraries to help you get up and running quickly while following best practices, a design pattern library with tried-and-tested components and agentic Markdown documentation and custom Skills for AI-assisted development.
Status
This project is best described as "pre-alpha". While based on working projects in production, this is a new repo and the template has not yet been tested by external users. Expect many breaking changes and rough edges.
Audience
This template is built for solo developers building side projects and small SaaS applications. It encodes one person's proven defaults (stack choices, hosting provider, deployment topology) rather than aiming to be a general-purpose starter kit.
This project is intended for experienced developers who are comfortable with the stack choices and general web development concepts. It gives new projects a working foundation and assumes you already know the stack.
This project provides AI-related features for those who wish to use LLMs as part of their workflow, but this is not a requirement and the project can be used without these features. You should always be comfortable taking the wheel and reviewing and modifying the code by hand as needed.
Getting Started
You need uv,
just,
Docker and the
GitHub CLI (gh). uv installs Python for you.
There are two ways to create a project: with the Claude Code plugin, which asks you questions and sets everything up, or with Copier directly. Both produce the same project.
With Claude Code
-
Install the plugin. Run these two commands in your shell, from any directory: they install the plugin for your user account, not for the current directory, so you only do this once.
claude plugin marketplace add danjac/django-studio --sparse .claude-plugin claude plugin install django-studio@django-studio
The first command registers this repository as a plugin source.
--sparse .claude-pluginskips the template, tests and images, which the plugin doesn't need. The second installs the plugin, fetching only itsplugin/directory. -
Start Claude Code in the directory where you keep your projects:
/djs-bootstrapcreates the project in a new subdirectory named after it, such asrecipe_box/. If you start it in an empty directory instead, it uses that directory. -
Describe the project to
/djs-bootstrap:/djs-bootstrap "recipe sharing site for home cooks"The skill checks your tools, then asks for anything your description didn't cover: the project name, author, domain and licence (the same answers as the Copier prompts below), and a few questions about the product: core entities, user roles, public or login-only, languages, and whether it needs an API, webhooks or background tasks. The product answers become the project overview in
docs/this-project.md, which the project's agents read.It then generates the project, starts the Docker services, installs dependencies, creates the database, runs every check with
just check-all, and makes the first commit. It offers to create a GitHub repository, and waits for you to confirm first. This takes several minutes. -
Quit Claude Code and start it again in the project directory:
The project comes with its own
/djs-*skills and agent docs, which load only in a session started there. -
Give the project its first shape with the project's
/djs-kickoffskill, unless you already ran it when/djs-bootstrapoffered. It works fromdocs/this-project.md: it proposes changes to theUsermodel, an app and model breakdown for your core entities (created only after you confirm it), sets up the extra languages, fills in the rest of the project docs, and writes a backlog of what comes next. Each step can be skipped, and it commits whenjust check-allpasses. Then run/djs-backlog nextto pick up the first item.
/djs-bootstrap is also available as /django-studio:djs-bootstrap, in case
another plugin uses the same name.
Updating the plugin
The plugin only affects new projects. To get the latest /djs-bootstrap, run:
claude plugin marketplace update django-studio claude plugin update django-studio@django-studio
Projects you have already generated don't change when the plugin updates. Run
/djs-sync inside a project to pull template changes into it (see
Updating a generated project).
With Copier
uvx copier copy --trust gh:danjac/django-studio my-project
Then follow the prompts:
| Prompt | Example | Notes |
|---|---|---|
project_name |
My Project |
Human-readable name |
project_slug |
my_project |
Python package directory name |
package_name |
my_project |
Python package name (snake_case) |
description |
A project that does X |
One-sentence description |
author |
Your Name |
|
author_email |
you@example.com |
|
domain |
example.com |
Production domain |
license |
MIT |
MIT, Apache-2.0, GPL-3.0, AGPL-3.0, LGPL-3.0, MPL-2.0, BSD-2-Clause, BSD-3-Clause, ISC, EUPL-1.2, None |
Copier prints the setup steps when it finishes.
For a guided start, run /djs-kickoff in Claude Code inside the new project. It
installs and commits the scaffold if you haven't yet, asks the product questions,
and records the answers in docs/this-project.md before shaping the project.
Generating from a branch
To generate from a specific branch (e.g. to test a pre-release feature):
uvx copier copy --trust "gh:danjac/django-studio@branch-name" my-projectUpdating a generated project
Once a project has been generated and committed, you can pull in template updates:
cd my-project
uvx copier update --trustCopier performs a 3-way merge so your local changes are preserved. Resolve any conflicts, then commit.
The generated README.md will include instructions to get started with development, testing, and deployment.
Features
- Django 6 with a modern stack (HTMX, Alpine.js, Tailwind CSS)
- Docker Compose setup for local development (PostgreSQL, Redis, Mailpit)
- Kubernetes deployment with Helm Charts
- Grafana dashboards for OpenTelemetry monitoring
- Terraform IaC scripts for provisioning Hetzner Cloud infrastructure and Cloudflare DNS
- Design system with reusable components
- AI-assisted development with agent documentation, agentic hooks, project Skills, and MCP servers (PostgreSQL, Playwright, Django shell)
Stack
- Python 3.14, Django 6.1, PostgreSQL 18, Redis 8
- HTMX + Alpine.js + Tailwind CSS (no JS build step)
- uv for dependency management
- just for task running
- Django tasks for background tasks (instead of Celery)
- django-allauth for authentication
- pre-commit hooks for linting
- Cloudflare for DNS, CDN, SSL, and DDoS protection
- Hetzner Cloud for hosting (K3s) and object storage
- Full test coverage (pytest + Playwright)
The goal is a simple foundation, both for the people using the app and for the developers building it. Django is a tried and tested framework with a strong emphasis on convention and best practices, making it an ideal choice for the backend. For the frontend, HTMX and Alpine.js provide a powerful combination for building dynamic interfaces without the complexity of a full JavaScript framework, while Tailwind CSS offers a utility-first approach to styling that promotes consistency and rapid development.
A guiding principle throughout is Locality of Behaviour: the behaviour of a piece of code should be obvious from looking at that code. HTMX, Alpine.js and Tailwind all put behaviour and styling directly on the element, and the generated project applies the same idea to its Python code - tests live beside the modules they test, feature code (such as an app's API or webhooks) lives in the app that owns it, and shared abstractions are extracted only once more than one app uses them. See template/docs/project-structure.md for details.
Further reading:
- Locality of Behaviour - Carson Gross, the htmx essay that names the principle
- Colocation - Kent C. Dodds on keeping code, tests and styles close to where they are used
- The Wrong Abstraction - Sandi Metz on why duplication is cheaper than a premature abstraction
- CSS Utility Classes and "Separation of Concerns" - Adam Wathan, creator of Tailwind CSS, on styling at the element
K3s is a lightweight Kubernetes distribution that allows for easy deployment and scaling of applications. By using K3s, we can ensure that our application is production-ready and can handle increased traffic as needed. Helm Charts have been provided to deploy your project along with Grafana dashboards for monitoring. Full Github Actions CI/CD pipelines are included for testing and deployment.
This stack will be assessed constantly to ensure it remains the best choice for the target audience and use cases. If better tools or libraries become available, they will be evaluated and potentially integrated into the template in addition to or in place of the current choices.
If you want to change any of the fundamental building-blocks of the stack - for example, switching from HTMX to React, or deploying to AWS instead of Hetzner - you are encouraged to make the changes you need in your project or fork this repository. The goal is to provide a solid starting point, not to lock you into a specific stack or workflow that does not suit your needs.
Design system
UI components are provided by DaisyUI, a Tailwind CSS component library with 50+ production-ready components, built-in dark mode, and semantic theming. DaisyUI is vendored as .mjs files (no npm required) and works with the django-tailwind-cli standalone binary.
- 50+ ready-made components (buttons, forms, modals, drawers, tabs, etc.)
- Automatic dark/light mode via DaisyUI themes
- Semantic color system (
primary,secondary,error, etc.) - Focus on accessibility
- Responsive layouts
Skills
Generated projects include djs-* Claude Code and OpenCode slash commands for common workflows:
General
| Command | Summary |
|---|---|
/djs-bootstrap |
Start a new project: interview, run Copier, write docs/this-project.md, smoke test (Plugin skill: see With Claude Code) |
/djs-kickoff |
Shape a new project from docs/this-project.md: user model, apps, languages, docs, backlog |
/djs-backlog |
Keep the backlog and changelog current, pick up the next item, cut a release |
/djs-help |
List all djs-* commands or show help for a specific command |
/djs-sync |
Preview the changelog, pull latest template changes via Copier and resolve merge conflicts interactively |
/djs-feedback |
Report a bug or improvement against the django-studio template |
/djs-doc |
Create or update project-specific docs: domain, apps, rules, APIs, integrations |
Generators
| Command | Summary |
|---|---|
/djs-create-app |
Create a Django app (apps.py, models, views, urls, admin, tests) |
/djs-create-view |
Add a view, template, and URL |
/djs-create-task |
Add a django-tasks-db background task with correct async patterns |
/djs-create-command |
Add a management command with tests |
/djs-create-model |
Design and write a Django model with recipe, fixture, and model tests |
/djs-create-migration |
Create a data migration (Python or SQL) |
/djs-create-crud |
Generate full CRUD views, templates, URLs, and tests |
/djs-create-e2e |
Write Playwright E2E test(s) for a described user interaction |
/djs-create-tag |
Add a template tag (simple_tag, simple_block_tag, inclusion_tag, Node) |
/djs-create-filter |
Add a template filter with correct escaping flags |
Localisation
| Command | Summary |
|---|---|
/djs-localize |
Add localization formats, extract strings, translate with TranslateBot, compile .mo catalogue |
Audits
| Command | Summary |
|---|---|
/djs-perf |
Performance audit: N+1 queries, missing indexes, caching, async |
/djs-secure |
Security audit: settings, views, XSS, CSRF, IDOR, SQL injection |
/djs-gdpr |
GDPR compliance audit: PII in models, erasure, consent, logging |
/djs-a11y |
Accessibility audit: WCAG 2.1 AA — forms, icons, HTMX, Alpine, semantic HTML |
/djs-seo |
SEO audit: robots.txt, meta tags, HTMX crawlability, sitemaps |
/djs-deadcode |
Remove unused Python code, templates, static assets and dependencies |
/djs-remove-slop |
Audit and remove Django anti-patterns introduced by AI or inattentive devs |
/djs-full-coverage |
Enable 100% coverage gate and write tests for all uncovered lines |
/djs-full-audit |
Run all audits in one sweep and combine the findings into one report |
Deployment
| Command | Summary |
|---|---|
/djs-deploy |
Interactive first-deploy wizard: provisions infra, configures secrets, deploys |
/djs-deploy-observe |
Deploy the observability stack (Grafana + Prometheus + Loki) |
/djs-tailscale [cmd] |
Enable, check or disable Tailscale private networking for the cluster |
/djs-scale [n] |
View or change the webapp replica count |
/djs-rotate-secrets |
Rotate auto-generated and third-party Helm secrets and redeploy |
/djs-enable-db-backups |
Enable automated daily PostgreSQL backups to a private Object Storage bucket |
/djs-db-backup |
Trigger an immediate database backup without waiting for the daily cron |
/djs-db-restore |
Guided production database restore from Object Storage backup |
/djs-deploy-cron |
Schedule a management command as a Kubernetes cron job |
Feedback Loop
Two skills in particular are designed to help you provide feedback on the template itself: djs-sync and djs-feedback. The first allows you to pull in the latest template changes and resolve any merge conflicts interactively, while the second lets you report bugs or suggest improvements directly from your project.
This alleviates a common issue with template projects: once a project is generated, it can be difficult to keep it up to date with the latest improvements and fixes. By providing these skills, we aim to create a feedback loop that benefits both the template maintainers and the developers using it. As more developers use django-studio, we expect to receive valuable feedback that will help us refine the template and make it even more useful for the community.
MCP Servers
Generated projects include project-local MCP servers configured in .mcp.json (gitignored, generated at project creation). These give AI assistants direct access to your local development environment.
| Server | Purpose |
|---|---|
@modelcontextprotocol/server-postgres |
Direct database queries and schema inspection |
@playwright/mcp |
Browser automation and E2E test debugging |
mcp-django |
Django shell — ORM queries, model introspection, arbitrary Python |
See docs/mcp.md in the generated project for usage and security notes.
Hosting
Hetzner Cloud is a cost-effective, EU-based hosting provider. Cloudflare is currently the cheapest and most secure option for DNS, CDN, SSL, and DDoS protection. These solutions will be reviewed on a regular basis - if better options become available, they will be offered instead of or addition to these choices.
The point is that hosting is low and fixed. You pay per server, not per request, so the bill is the same whether the app is idle or busy - no egress charges, no per-request fees, no autoscaling that runs away. The default single-node topology is the cheapest option, and each role you split onto its own node adds exactly one server to the bill. See Hetzner's pricing for current rates.
Private networking with Tailscale
Tailscale is supported as an optional extra. When enabled, every node joins a private WireGuard mesh and SSH and the Kubernetes API travel over the tailnet instead of the public internet, so ports 22 and 6443 can be closed to everyone else. Ports 80 and 443 stay open for web traffic via Cloudflare.
It is off by default - there is no Copier question for it. Set tailscale_oauth_client_secret in terraform/hetzner/terraform.tfvars, or run /djs-tailscale enable, which handles both a fresh deploy and retrofitting a cluster that is already running.
Tailscale's free tier covers 3 users and 100 devices, so for solo projects and small teams this adds no cost. See docs/infrastructure.md in the generated project for the full setup.
Requirements
Development
| Tool | Purpose | Install |
|---|---|---|
| uv | Python package manager (runs uvx copier) |
curl -LsSf https://astral.sh/uv/install.sh | sh |
| just | Task runner | cargo install just or via your OS package manager |
| Docker + Compose | PostgreSQL, Redis, Mailpit | See Docker docs |
| gh | GitHub CLI (issues, PRs) | See install docs |
Python 3.14 is managed automatically by uv - no separate install needed.
Deployment
| Tool | Purpose | Install |
|---|---|---|
| Terraform | Provision Hetzner infrastructure and Cloudflare DNS | See install docs |
| Helm | Deploy Kubernetes workloads | See install docs |
| kubectl | Kubernetes CLI | See install docs |
| hcloud | Hetzner Cloud CLI | See install docs |
| tailscale | Only if Tailscale is enabled - required to reach the cluster | See install docs |
See docs/deployment.md in the generated project for full deployment instructions.
