Django SaaS
A modular foundation for building multi-tenant SaaS products with Django.
Features
- Multi-Tenancy: Flexible tenant discovery (Header, Path, Session).
- Identity & Authentication: Robust user management with Password and SSO (Google, GitHub, Apple) support.
- Organization & RBAC: Tenant-level organization with Members, Groups, and a global Permission/Role registry.
- Custom Domains: Support for custom domain management and verification.
- API First: Enhanced DRF integration with tenant-aware filters and permissions.
- Developer Tools: Pre-configured SKILLs for AI-assisted development.
Install
pip install django-saas
Configuration
Add the required apps to your Django project's settings.py:
INSTALLED_APPS = [
# ...
'saas',
'saas.identity',
'saas.tenancy',
'saas.sessions',
'saas.tokens',
'saas.domain',
'saas.sso',
'saas.drf',
]
AUTHENTICATION_BACKENDS = [
'saas.identity.backends.ModelBackend',
'saas.sso.backends.UserIdentityBackend',
'django.contrib.auth.backends.ModelBackend',
]
MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
# SaaS Middlewares
'saas.middleware.HeaderTenantIdMiddleware',
'saas.middleware.PathTenantIdMiddleware',
'saas.middleware.SessionTenantIdMiddleware',
'saas.middleware.TenantMiddleware',
'saas.sessions.middleware.SessionRecordMiddleware',
]
REST_FRAMEWORK = {
'DEFAULT_AUTHENTICATION_CLASSES': [
'rest_framework.authentication.SessionAuthentication',
'saas.tokens.authentication.TokenAuthentication',
],
'DEFAULT_SCHEMA_CLASS': 'saas.drf.spectacular.AutoSchema',
}
URL Configuration
Include the SaaS URLs in your project's urls.py:
from django.urls import include, path
urlpatterns = [
path('api/', include('saas.api_urls')),
path('sso/', include('saas.sso.auth_urls')),
]
Documentation for AI Agents
This project includes specialized context for AI developers. If you are using an AI assistant, point it to AGENTS.md and the skills/ directory for automated workflows.
License
BSD-3-Clause
Metadata
Release files for django-saas 0.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| django_saas-0.3.0.tar.gz | 147.4 kB | With provenance | Details for django_saas-0.3.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| django_saas-0.3.0-py3-none-any.whl | Python 3 | none | any | Details for django_saas-0.3.0-py3-none-any.whl |
Total release size: 334.9 kB
Release files / django_saas-0.3.0.tar.gz
| Download URL | django_saas-0.3.0.tar.gz |
|---|---|
| Size | 147.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b2763ed0d4680f44fc1c4d47abb9790aec261bbc1515f789456f4250efac7bdf
|
|
BLAKE2b-256 checksum How to use checksums |
1fcab8e2c54604c03d0ffbf9e27887dac9801a6912431a76840d56698c3eaf8a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 12, 2026.
Transparency logRelease files / django_saas-0.3.0-py3-none-any.whl
| Download URL | django_saas-0.3.0-py3-none-any.whl |
|---|---|
| Size | 187.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
809167240af999e58102dda1c8024987fb18840c474c0930c8b3e8ad16fdf897
|
|
BLAKE2b-256 checksum How to use checksums |
a41165211f560b181f156ec4c917f2664a1edbfdceb94ff615d3189a6497be9b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 12, 2026.
Transparency logSecurity for django-saas 0.3.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for django_saas-0.3.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 12, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.