# bernardopires/django-tenant-schemas

Tenant support for Django using PostgreSQL schemas.

Repository: https://github.com/bernardopires/django-tenant-schemas
Canonical: https://ross.abutalabs.com/products/django-tenant-schemas
Homepage: https://django-tenant-schemas.readthedocs.org/en/latest/
Language: Python
License: MIT
License Family: permissive
Last push: 2026-02-11T08:55:29+00:00

## Health v2 (maintenance only)
Score: 56/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 67, release rhythm 17, longevity 100
- inputs: {"age_days": 5184, "days_push": 203, "days_rel": 341, "gap_med": null, "n_releases_24m": 1}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1520, forks 426 (observed 2026-08-28T04:04:57.759749+00:00)

## What it is
A Django app that provides multi-tenancy using PostgreSQL schemas, letting a single project instance serve many tenants with shared and tenant-specific data. Tenants are identified by hostname and routed to their own schema via middleware.

## Use cases
- build a SaaS where each customer gets isolated data on one Django instance
- serve multiple tenants from a single database using separate PostgreSQL schemas
- route requests to tenant-specific schemas based on subdomain
- share some data across tenants while keeping tenant-specific tables separate
- avoid running one copy of the app per customer

## When to choose
- you use Django with PostgreSQL and want schema-based multitenancy
- you want minimal code changes to add tenant isolation
- you prefer one database with per-tenant schemas over one database per tenant

## When to avoid
- you don't use PostgreSQL
- you need the shared-schema approach with a tenant foreign key
- your project is not Django

## Facets
- artifact type: library
- maturity: maintenance
- function: middleware, routing, database, orm
- domain: web-development, backend, databases
- platform: python
- tags: django, postgresql-schemas, multitenancy, saas, host-based-routing, multi-tenancy, web-server

## Member repositories
- bernardopires/django-tenant-schemas (main) score 56

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:04:57.759749+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T04:31:54.095522+00:00, confidence not recorded.
  - readme: https://github.com/bernardopires/django-tenant-schemas (fetched 2026-08-28T04:04:57.759749+00:00, sha 21c0329ade8f)
- Data as of 2026-08-30T08:39:29.467469+00:00.
