A lightweight, fully‑featured multi‑tenant SaaS platform built on Django, providing tenant isolation, billing integration and a RESTful API.
django-saas-multi-tenant is designed for developers who need to spin up a secure, scalable SaaS application with minimal friction.
It isolates each customer (tenant) at the database level, handles subscription billing via Stripe, and exposes CRUD APIs that respect tenant boundaries. The project comes bundled with Docker, CI/CD pipelines, and automated tests.
- Tenant isolation – separate schemas per tenant using
django-tenants. - Row‑level security – automatic filtering of data to the current tenant.
- Billing & subscription management – Stripe integration with webhooks and usage metering.
- REST API – versioned endpoints, pagination, custom permissions.
- Admin UI – per‑tenant dashboards and billing panels.
- Docker & Docker Compose – reproducible development environment.
- CI/CD – GitHub Actions workflow for linting, testing, and building images.
- Testing suite – unit tests for models, views, API endpoints, and billing logic.
| Component | Technology |
|---|---|
| Web framework | Django 5.x |
| Database | PostgreSQL (schema‑based multi‑tenancy) |
| ORM & migrations | django‑tenants, South |
| Billing | Stripe SDK |
| API | Django REST Framework |
| Asynchronous support | ASGI + Channels |
| Frontend | HTMX + Tailwind CSS (via static files) |
| Containerization | Docker, docker‑compose |
| CI | GitHub Actions |
# Clone the repository
git clone https://github.com/jammyjam-j/django-saas-multi-tenant
cd django-saas-multi-tenant
# Build and start containers
docker compose up -d --build
# Run migrations
docker compose exec web python manage.py migrateThe application will be accessible at http://localhost:8000.
curl -X POST http://localhost:8000/api/tenants/ \
-H "Content-Type: application/json" \
-d '{"domain":"acme.example.com","name":"Acme Corp"}'The response includes the tenant ID and schema name.
curl -X POST http://localhost:8000/api/billing/subscribe/ \
-H "Content-Type: application/json" \
-d '{"tenant_id":1,"plan":"pro","stripe_token":"tok_visa"}'Navigate to http://localhost:8000/dashboard/acme.example.com/ to view the tenant‑specific interface.
| Method | Path | Description |
|---|---|---|
| POST | /api/tenants/ |
Create a new tenant |
| GET | /api/tenants/{id}/ |
Retrieve tenant details |
| POST | /api/billing/subscribe/ |
Subscribe a tenant to a plan |
| POST | /api/billing/cancel/ |
Cancel an active subscription |
| GET | /api/dashboard/ |
List tenants for the current user |
All endpoints are versioned under /api/v1/. Refer to api/schemas.py for detailed schemas.
- Building a multi‑tenant SaaS on Django
- GitHub – ychtsa/django_multitenant_saas
- 2026 Django SaaS Starter Kit
- Create a Tenant with Django – Part 2
- Field‑Ready Complete Guide to Multi‑Tenant SaaS
- How to Build a Multi‑Tenant SaaS Application with Django
- DjangoTenants – Multi‑Tenant SaaS Development
- Unveiling the Power of Multi‑Tenancy: An Abstract Understanding
- Show HN – ReadyKit – Superfast SaaS Starter with Multi‑Tenant
- Laravel vs Django and Rails for SaaS Development
Please read the contribution guidelines in the repository.
Issues and pull requests are welcome: https://github.com/jammyjam-j/django-saas-multi-tenant/issues.
MIT © 2026