Hey There! I Built a Django + HTMX SaaS Boilerplate (And You're Gonna Love It)

Hey There! I Built a Django + HTMX SaaS Boilerplate (And You're Gonna Love It)
Hey everyone! Erik here. Today I want to share something I've been working on that's saved me tons of time, and I think it might help you too.
"Building a SaaS app from scratch is a pain - setting up user auth, payment systems, and creating a decent UI takes forever! That's why I built something to solve this problem once and for all." – Erik Taveras
Introducing My Django + HTMX SaaS Boilerplate!
I've put together a complete, ready-to-rock Django boilerplate specifically for SaaS applications. It combines my favorite tech stack: Django 5.0, HTMX, Tailwind CSS, and Alpine.js.
Why This Tech Stack Rocks
Django 5.0
Django has been my go-to backend framework for years. It's solid, secure, and gives you so much right out of the box. Version 5.0 is faster than ever and has some really cool new features.
HTMX
This is the game-changer! HTMX lets you create dynamic, interactive interfaces directly from your HTML. No need to write tons of JavaScript or set up a complex front-end framework. Just add some attributes to your HTML, and boom – you've got dynamic content.
Tailwind CSS
I used to spend hours writing custom CSS. Then I discovered Tailwind, and now I can build beautiful UIs in half the time. Its utility-first approach just makes sense to me, and I love how quickly I can translate designs into working interfaces.
Alpine.js
When I need a bit more interactivity than HTMX provides, Alpine.js is my secret weapon. It's like having the power of Vue or React but in a tiny 8KB package. Perfect for those interactive components that need a bit more client-side logic.
What's Included in the Boilerplate?
Authentication & User Management
- Complete user auth system with django-allauth
- Email verification that actually works
- User profiles that are easy to extend
- Role-based permissions for access control
Subscription & Payment Processing
- Stripe integration for handling payments
- Multiple pricing tiers ready to go
- Webhook handling for all Stripe events
- User-friendly subscription dashboard
Pre-built UI Components
- A landing page that doesn't look like a template (I promise!)
- User dashboard with all the essentials
- Admin panel that's actually pleasant to use
- Everything works great on mobile (because it's 2025, folks)
How the Project is Structured
I've organized everything in a way that makes sense (at least to me):
├── core/ # The main Django project ├── apps/ # All the Django applications │ ├── accounts/ # User stuff │ ├── landing/ # Your public-facing pages │ ├── dashboard/ # Where users go after logging in │ └── subscriptions/ # All the payment/subscription logic ├── static/ # CSS, JS, images, etc. ├── templates/ # All your HTML templates └── manage.py # The usual Django management script
Getting Started is Super Easy
Want to try it out? Here's how:
1. Clone the repo:
git clone https://github.com/eriktaveras/django-saas-boilerplate.git cd django-saas-boilerplate
2. Set up your environment:
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate pip install -r requirements.txt
3. Run the usual Django commands:
python manage.py migrate python manage.py createsuperuser python manage.py runserver
And just like that, you've got a working SaaS app running at http://localhost:8000
. Pretty cool, right?
Why I Think You'll Love This Boilerplate
It'll Save You Weeks of Development Time
Why spend weeks setting up auth, payments, and UI components when you could be building the features that make your app unique?
It Uses Modern Best Practices
I've poured all my Django knowledge into this boilerplate - all the security best practices, performance optimizations, and coding standards I've learned over the years.
It's Built to Grow With You
The structure is designed to scale as your app grows, so you won't need to refactor everything once you get some traction.
You Can Focus on What Matters
With all the boring stuff taken care of, you can focus on what makes your SaaS special – the features your users actually care about.
What Can You Build With This?
This boilerplate is super versatile. I've already used it as a starting point for:
- A content management system for a local business
- A project management tool for my freelance work
- A simple CRM for a small marketing agency
- An online course platform for a friend who's a fitness instructor
But honestly, you could use it for pretty much any subscription-based web app you can think of!
Let's See Some Code
Here's a quick example of how easy it is to work with HTMX in this boilerplate:
# Here's a quick example of how easy it is to work with HTMX in this boilerplate from django.shortcuts import render from django.contrib.auth.decorators import login_required @login_required def dashboard_stats(request): # Get some stats for the current user user_stats = { 'projects': request.user.projects.count(), 'storage_used': get_storage_used(request.user), # My helper function 'plan': request.user.subscription.plan_name if hasattr(request.user, 'subscription') else 'Free', 'days_left': get_days_remaining(request.user), # Another helper function } # Here's the HTMX magic - if it's an HTMX request, just return the partial if request.headers.get('HX-Request'): return render(request, 'components/stats_card.html', {'stats': user_stats}) # Otherwise return the full dashboard return render(request, 'dashboard/home.html', {'stats': user_stats})
Want to Speed Up Your Next SaaS Project?
Look, I know there are a ton of boilerplates out there. But I built this one specifically for modern SaaS applications, using a tech stack that I personally love and use every day.
The combination of Django's robust backend, HTMX's simplicity, Tailwind's utility-first approach, and Alpine.js's lightweight interactivity creates a foundation that's both powerful and enjoyable to work with.
Whether you're a Django veteran or just getting started, I think this boilerplate will help you launch your next SaaS project faster and with less headache.
Downloads
Share this article

Erik Taveras
Backend Developer
Helping businesses build secure, scalable backend systems. Specialized in Python, Django, and PostgreSQL.
Work with meRelated Articles
No related articles found.
Stay Updated
Get notified about new articles and resources.
I respect your privacy. Unsubscribe at any time.
Need Help With Your Project?
I specialize in building secure, scalable backend solutions for businesses.
Get in Touch