Skip to main content

saas framework django htmx: Best Boilerplates & Starters (2026)

·StarterPick Team
djangohtmxpythonsaasboilerplate2026

Django + HTMX has become the most compelling SaaS stack for Python developers in 2026 — and for good reason. You get Django's batteries-included backend, PostgreSQL-native ORM, class-based views, and a mature ecosystem, paired with HTMX's hypermedia-driven UI that eliminates the JavaScript build pipeline entirely. No webpack, no Vite, no npm. Just Python all the way down.

The results are real. In the most-cited Django + HTMX migration case study (Contexte), a team replaced a 2-year-old React UI with Django templates + HTMX in a couple months — achieving 67% fewer lines of code (21,500 → 7,200), 96% fewer JavaScript dependencies (255 → 9), and 50–60% faster first-load time-to-interactive. This isn't just developer ergonomics — it's measurable product improvement.

But the ecosystem is fragmented. Some "boilerplates" are glorified scaffolds. Some are production-tested SaaS frameworks. Some haven't been updated in two years. This guide cuts through it: here are the best Django + HTMX SaaS frameworks and starters available in 2026, ranked honestly.

TL;DR

SaaS Pegasus is the best Django + HTMX boilerplate with money ($249 one-time). It's the only premium option with first-class HTMX support and ships production-ready multi-tenancy, billing, background tasks, and admin in a single download. djaodjin is the best free option if you need multi-tenant billing. Cookiecutter Django is the right foundation if you're building custom. django-saas-starter handles MVPs on zero budget.

Key Takeaways

  • SaaS Pegasus is the only premium Django boilerplate with configurable React OR HTMX frontend
  • HTMX 2.0 (released late 2024) brings WebSocket support and new hx-on:* event syntax — 2026 boilerplates should target HTMX 2.x
  • Python AI/ML is the killer advantage — Django + HTMX lets you use scikit-learn, LangChain, and Hugging Face directly without microservice overhead
  • djaodjin's URL-based multi-tenancy is the most battle-tested free multi-tenant approach in the Django ecosystem
  • Cookiecutter Django is a scaffold, not a boilerplate — it creates a solid structure but adds no SaaS features (billing, multi-tenancy, etc.)
  • The $249 vs free decision reduces to how much your time is worth: Pegasus pays for itself in the first 2 hours of billing setup alone

Why Django + HTMX for SaaS in 2026?

The JavaScript ecosystem has grown increasingly complex. A default Next.js SaaS has React 19, TypeScript, Tailwind, Prisma, NextAuth, Stripe, and a deployment pipeline to manage — plus the cognitive overhead of understanding client/server boundaries, hydration, and bundle optimization.

Django + HTMX eliminates this entire layer:

Django + HTMX SaaS stack:
  Backend:     Django 5.x — routing, ORM, auth, admin, sessions, forms
  Database:    PostgreSQL via psycopg3 (or SQLite for development)
  Auth:        django-allauth — email, Google, GitHub, MFA, passkeys
  Frontend:    HTMX 2.0 — partial HTML swaps, no JavaScript framework
  Interactivity: Alpine.js 3 — lightweight client-side state where needed
  Styling:     Tailwind CSS 4 (or Bootstrap 5 for legacy projects)
  Background:  Celery + Redis — async tasks, scheduled jobs
  Billing:     Stripe via djstripe or django-stripe
  Deployment:  Gunicorn + Nginx, Railway, Render, or Fly.io

Compare this to package.json in a Next.js T3 stack — often 40+ dependencies — and the Python side looks refreshingly lean.

HTMX 2.0: What Changed

HTMX 2.0 shipped in October 2024 with breaking changes from 1.x. Key updates relevant for SaaS:

<!-- HTMX 2.0: new hx-on:* event syntax (replaces hx-on="htmx:afterSwap:...") -->
<form
  hx-post="/api/members/invite"
  hx-target="#member-list"
  hx-swap="afterend"
  hx-on:htmx:after-request="this.reset()"
>
  <input type="email" name="email" placeholder="colleague@company.com" />
  <button type="submit">Invite</button>
</form>

<!-- HTMX 2.0: WebSocket support for real-time features -->
<div hx-ext="ws" ws-connect="/ws/dashboard/">
  <div id="live-stats" hx-swap-oob="true">
    <!-- Server pushes partial HTML updates here -->
  </div>
</div>

<!-- HTMX 2.0: hx-boost on entire section for SPA-like navigation -->
<nav hx-boost="true">
  <a href="/billing/">Billing</a>
  <a href="/team/">Team</a>
  <a href="/settings/">Settings</a>
</nav>

Boilerplates targeting HTMX 1.x will need updates. The ones below all support 2.0 or higher.


The Comparison

StarterPriceHTMXMulti-TenantAuthBillingAIDjango
SaaS Pegasus$249–$699✅ 2.0 native✅ Teams + RBACFull (allauth + MFA)Stripe + Paddle✅ Built-in5.x
djaodjinFree (BSD*)⚠️ Add yourself✅ URL-based✅ Built-inStripe native4.x/5.x
Cookiecutter DjangoFree (BSD)⚠️ Add yourselfallauth4.x/5.x
FalcoFree (MIT)✅ Configuredallauth5.x
HyperionFree (MIT)✅ HTMX-firstallauthStripe5.0
cangeorgecodeFree + Paid✅ HTMX-firstallauthPaid tier5.x
Community startersFreeallauthStripe4.x/5.x

The Starters, Ranked

1. SaaS Pegasus — Best Overall

Price: $249 (Starter) / $449 (Professional) / $699 (Unlimited) Creator: Cory Zue (indie developer, $100K+/year from this product) GitHub: Private repository (download on purchase) Customers: 1,854+ including YC-backed companies Rating: ⭐⭐⭐⭐⭐ (5.0/5 on Trustpilot, 40+ reviews)

SaaS Pegasus is the only premium Django boilerplate that offers configurable frontend mode — you choose React or HTMX when you download. The HTMX mode is first-class, not an afterthought.

What you get in HTMX mode:

# Pegasus uses class-based views with HTMX partial returns
class TeamMembersView(LoginRequiredMixin, PermissionRequiredMixin, View):
    """Handles team member management with HTMX partial renders."""

    def get(self, request, team_slug):
        team = get_object_or_404(Team, slug=team_slug)
        members = team.membership_set.select_related("user").all()
        # Full page render for direct visits
        return render(request, "teams/members.html", {"team": team, "members": members})

    def post(self, request, team_slug):
        form = InviteForm(request.POST)
        if form.is_valid():
            invitation = send_invitation(team, form.cleaned_data["email"])
            # Partial HTML return for HTMX requests
            return render(request, "teams/partials/member_row.html", {"invitation": invitation})
        return render(request, "teams/partials/invite_error.html", {"form": form})

Full feature list:

  • Auth: django-allauth with email, Google, GitHub, Apple, MFA, and passkeys
  • Teams/Orgs: Multi-tenant with invitations, roles (admin/member), per-team billing
  • Billing: Stripe (subscriptions, usage-based, one-time payments) and Paddle
  • Admin: Customized Django admin with user impersonation for support
  • Background: Celery + Redis configured with beat scheduler
  • AI (Professional+): OpenAI chat and image generation pre-integrated
  • APIs: Django REST Framework with token authentication
  • Deployment: Docker Compose, Heroku, Railway, Render configs included
  • Frontend: Tailwind CSS + DaisyUI (optional Bootstrap), HTMX 2.0, Alpine.js

Pricing breakdown:

TierPriceProjectsAILicense
Starter$2491 commercialLifetime code, 1yr updates
Professional$4491 commercialLifetime code, 1yr updates
Unlimited$699UnlimitedLifetime code, 1yr updates

Verdict: If your hourly rate is above $15, SaaS Pegasus pays for itself the first morning. The billing integration alone — Stripe webhooks, subscription states, upgrade/downgrade flows — takes 2-3 days to build correctly from scratch. Pegasus ships all of it working.


2. djaodjin — Best Free Billing-First Framework

Price: Free (BSD license) Creator: DjaoDjin Inc (runs their own SaaS on it) GitHub Stars: ~1.2k Django: 4.x/5.x compatible

djaodjin is the most complete free Django SaaS framework — and it's battle-tested because the creators run real SaaS businesses on top of it. The architecture is split into composable Django apps:

  • djaodjin-saas — subscriptions, billing, multi-tenancy, and reporting
  • djaodjin-signup — authentication with Stripe-aware flows
  • djaodjin-pages — CMS-style page management
  • djaodjin-rules — declarative access control

The standout feature: URL-based multi-tenancy

djaodjin uses URL prefixes for organization isolation. Each tenant gets their own URL namespace (/orgs/acme/billing/) and access rules are managed in the database, not in code:

# djaodjin-rules: define access in settings, not scattered across views
RULES = [
    # managers can POST to /api/, subscribers can only GET
    ("/api/", {"POST": "manager", "GET": "subscriber"}),
    # only managers can access billing
    ("/billing/", {"ANY": "manager"}),
    # profile pages accessible to all authenticated users
    ("/profile/", {"ANY": "authenticated"}),
]

This is a fundamentally different approach from per-view @permission_required decorators — the rules are centralized and database-driven, so non-technical admins can adjust them.

HTMX integration: djaodjin's templates use older jQuery-style JavaScript in places, but the server-side rendering architecture maps cleanly to HTMX patterns. Adding HTMX is straightforward — the template structure already returns partials where needed:

# djaodjin view returns HTML partials on AJAX requests
class UserRelationListView(ListView):
    def get_template_names(self):
        if self.request.headers.get("HX-Request"):
            return ["saas/htmx/subscriber_list.html"]  # partial
        return ["saas/subscriber_list.html"]  # full page

Verdict: If you need multi-tenant billing without paying for Pegasus, djaodjin is the answer. The DX is less polished than modern stacks, but the billing and access control implementation is genuinely production-grade.


3. Cookiecutter Django — Best Project Scaffold

Price: Free (BSD) Creator: Daniel Feldroy (Two Scoops of Django) GitHub Stars: 22k+ Django: 4.2 / 5.x

Cookiecutter Django is the most-starred Django project generator — but it's important to understand what it is: a scaffold, not a SaaS boilerplate. It doesn't include billing, multi-tenancy, or production SaaS UI. It creates a well-structured Django project foundation:

  • Docker Compose for local development
  • PostgreSQL + psycopg3 configured
  • Celery + Redis setup
  • django-allauth for authentication
  • Custom user model (the right default)
  • WhiteNoise for static files
  • Pre-commit hooks + GitHub Actions CI

Adding HTMX to a Cookiecutter project:

pip install django-htmx
# settings.py
INSTALLED_APPS = [
    ...
    "django_htmx",
]
MIDDLEWARE = [
    ...
    "django_htmx.middleware.HtmxMiddleware",
]
<!-- base.html: add HTMX 2.0 -->
<script src="https://unpkg.com/htmx.org@2.0.4" crossorigin="anonymous"></script>
<!-- Optional: Alpine.js for client-side interactivity -->
<script src="https://unpkg.com/alpinejs@3.x.x/dist/cdn.min.js" defer></script>
# views.py: check request.htmx to return partial vs full page
from django_htmx.http import retarget

def search_view(request):
    q = request.GET.get("q", "")
    results = Product.objects.filter(name__icontains=q)[:10]

    if request.htmx:
        # Return just the results partial
        return render(request, "partials/search_results.html", {"results": results})
    # Return the full page
    return render(request, "search.html", {"results": results, "q": q})

Verdict: Use Cookiecutter if you have an experienced Django team that knows what you need and wants to build it your way. Use Pegasus or djaodjin if you need SaaS features shipped fast.


4. Falco — Best Minimal HTMX Starter (Free)

Price: Free (MIT) GitHub Stars: ~1k Django: 5.x HTMX: Pre-configured

Falco is a newer, opinionated Django starter that targets the modern stack: Django 5, HTMX 2.0, Alpine.js, Tailwind CSS 4, and htmx-ext extensions pre-configured. Unlike Cookiecutter, Falco includes a Makefile-driven development workflow and sensible defaults for Django deployment.

What Falco adds over Cookiecutter:

  • HTMX + Alpine.js pre-integrated (not add-it-yourself)
  • Tailwind CSS 4 with PostCSS configured
  • django-cotton for component-based templates
  • django-browser-reload for hot reloading during development
  • Production-ready deployment scripts for VPS

What it lacks:

  • No billing integration
  • No multi-tenancy
  • No pre-built SaaS UI

Verdict: Best free choice if you want the HTMX ecosystem pre-configured and plan to build custom SaaS features on top of it.


5. Hyperion (eriktaveras) — Best Free HTMX-First Starter

Price: Free (MIT) + paid premium version GitHub: github.com/eriktaveras/django-saas-boilerplate Stars: 83+ Django: 5.0

Hyperion is a purpose-built HTMX-first Django starter — not a Cookiecutter fork, not a paid product with a stripped-down free tier. Just clean Django 5 + HTMX + Tailwind + Stripe that the developer built for his own SaaS products and open-sourced.

Stack: Django 5.0, HTMX (no React option), Tailwind CSS, Alpine.js, PostgreSQL, django-allauth, Stripe subscriptions + one-time payments + trial periods, role-based access control, responsive dashboard.

Three-command setup to running server. The creator published a detailed write-up on DEV.to explaining the architecture — good due diligence read before forking.

Verdict: Best free choice if you want a modern HTMX-first stack with no React distraction and plan to build custom features on top.


6. cangeorgecode Django Boilerplate

Price: Free (open-source) + paid premium GitHub: github.com/cangeorgecode/Django_Boilerplate_Free Django: 5.x

Built by a developer who used it to ship 4 apps in 2 months. The free version covers Django 5, HTMX, Tailwind, and email auth. The paid version adds Wagtail CMS (same CMS option as SaaS Pegasus) and Stripe billing.

Notable: 63+ stars in the first 2 days after launch — strong signal for a niche boilerplate. HTMX-first with no React option. Wagtail bundled for content/blog features.

Verdict: Worth evaluating if you want HTMX + Wagtail CMS without the Pegasus price tag. Smaller community; paid tier pricing is not publicly listed.


7. Community Starters

Additional options for MVPs and learning:

  • PaulleDemon/Django-SAAS-Boilerplate — Free, Firebase storage, Stripe, i18n built-in, deploys to Vercel/Railway/Render
  • danjac/django-saas-starter — Opinionated cookiecutter variant for SaaS
  • ernestofgonzalez/djangorocket — Cookiecutter-based, Stripe + Tailwind + allauth

Audit GitHub before committing — check last commit date, Django version (5.x?), and whether HTMX 2.x is used. Some haven't been updated since 2024.


Django + HTMX vs Django + React: The 2026 Decision

For most B2B SaaS, HTMX is sufficient — and often superior:

ScenarioHTMX winsReact wins
Solo Python developer✅ One language, one mental model
Python AI/ML SaaS✅ Direct access to ML libraries
B2B dashboard (tables, forms, filters)✅ Less code
Internal tools✅ Build speed over UX polish
Content-heavy app✅ Server rendering is natural
Consumer mobile-first✅ Native-like interactions
Offline-capable app✅ Client-side state
Large JS team exists✅ Leverage existing skills
Real-time collaborative editing✅ Complex client state
React Native mobile app✅ Code sharing

The Python AI/ML angle is decisive in 2026. If your SaaS integrates LLMs, vector search, data pipelines, or ML models, Django + HTMX lets you call langchain, openai, chromadb, and scikit-learn directly from your Django views — no microservice layer, no API bridge between Python and JavaScript, no serialization overhead. This alone makes Django + HTMX the correct default for AI-powered SaaS built by Python teams.


Production Stack Reference

A complete, production-ready Django + HTMX SaaS stack in 2026:

Layer                    Technology
─────────────────────── ──────────────────────────────────────────
Web framework           Django 5.x
Database                PostgreSQL 16+ via psycopg3
ORM                     Django ORM (built-in)
Authentication          django-allauth 0.63+ (email, OAuth, MFA, passkeys)
Billing                 djstripe 2.9+ or Pegasus billing
Background tasks        Celery 5.x + Redis 7
Task scheduling         Celery Beat
Cache                   Redis 7 (cache backend)
Frontend interactivity  HTMX 2.0 + Alpine.js 3.x
Styling                 Tailwind CSS 4 (or Bootstrap 5)
Static files            WhiteNoise (dev) → S3/CloudFront (production)
File uploads            django-storages → S3
Email                   django-anymail → SendGrid/Postmark/Resend
Search                  django-watson or PostgreSQL full-text search
WSGI server             Gunicorn 21+
Reverse proxy           Nginx (self-hosted) or Caddy
Hosting                 Railway, Render, Fly.io, or VPS
Container               Docker + Docker Compose

Python dependencies for a full SaaS (requirements.txt):

django>=5.0
django-allauth[socialaccount]
django-htmx
celery[redis]
redis
psycopg[binary]
stripe
djstripe
gunicorn
whitenoise
django-environ
django-storages[s3]
django-anymail
pillow

Compare to a Next.js T3 stack: 40+ npm packages, TypeScript config, Prisma schema, NextAuth config, bundle optimization — the Python side is dramatically simpler.


Who Should Use Each

SaaS Pegasus — Python developers who want to ship fast and have $249. At typical contractor rates, the time savings on the first week alone are worth 10x the cost. Ideal for: indie hackers, B2B SaaS founders, Python teams with a product to build.

djaodjin — Developers who need multi-tenant billing without the cost. Takes more configuration than Pegasus but the billing and access control system is production-proven. Ideal for: bootstrapped projects, teams that want full source control without a license.

Cookiecutter Django — Teams with Django expertise building something custom. The scaffold gives you production defaults; you add the SaaS features you need. Ideal for: consulting shops, teams with specific architecture requirements.

Falco — Developers who want a modern Django + HTMX foundation (HTMX 2.0, Tailwind 4, Alpine.js configured) but don't need billing included. Ideal for: custom SaaS builds where you'll integrate your own billing.

Community starters — MVP validation and learning projects. Ideal for: proving concept before investing in Pegasus.


Browse all Django + HTMX boilerplates on StarterPick — filter by price, features, and frontend framework.

Related: SaaS Pegasus Review 2026 · Django vs Rails SaaS Starters · Best SaaS Boilerplates 2026

Check out this boilerplate

View SaaS Pegasus on StarterPick →

Comments