Skip to content

mainakchhari/django-htmx-tailwind-projectkit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Django + Htmx + Tailwind (template/starter)

A production-ready Django template designed for Python 3.12, 3.13, and 3.14. Built with modern tooling to ensure a fast developer experience and secure deployments.

Note

For a simpler version (no htmx/tailwind) see mainakchhari/django-projectkit

Warning

This template uses the src-layout structure

Quick Start

Create a new project using the Django CLI. Since this template includes modern configuration files, you must specify them for placeholder replacement using the -n (extension) flag:

django-admin startproject \
  --template=<TEMPLATE_ZIP_URL> \
  -n pyproject.toml,README.md \
  [YOUR_PROJECT_NAME]

The TEMPLATE_ZIP_URL should be the path to the latest release artifact, unless you want the latest changes

Next Steps

  • copy .env.dist to .env and get started with app-admin runserver
  • Uses uv for python tooling. Run uv sync to install app and deps
  • Run tailwindcss -i static/pre/input.css -o static/css/main.css --watch during dev to auto-preprocess css changes to output; run with --minify instead of --watch in production
  • Run migrations and start local server with app-admin (wrapper over manage.py)
  • Open browser and navigate to http://localhost:8000 - voila!
  • Ships with some opinionated deps - environ, htmx, tailwind
  • whitenoise serves assets in production (needs collectstatic)

Tooling Choices

This is an opinionated template focused on ease of use and good practices:

  • uv: Handles dependency management and virtual environments with extreme speed. Run uv sync to generate your uv.lock.
  • django-environ: Manages configuration via environment variables, keeping secrets secure.
  • whitenoise: Efficiently serves static files directly from Django, simplifying Docker and production deployments.
  • django-rich: Adds rich color output to test runners, runserver
  • django-htmx: template tags, middlware, etc
  • pytailwindcss

Production

  • the provided Dockerfile is optimized for production
  • run app-admin check --deploy when you start planning for production
  • versioning is maintained through src/{{ project_name }}/__about__.py -- single point of configuration

todo

  • tests (see django/django)

About

Template for django projects with htmx & tailwindcss; contains dockerfile and opinionated defaults

Topics

Resources

Security policy

Stars

Watchers

Forks

Contributors