Overview of django-pgschemas
masterdjango-pgschemas is a Django package that leverages PostgreSQL schemas to implement data multi-tenancy within a single project. It is a fork of django-tenants that introduces several key architectural improvements:
- Tenant Types: Supports both static tenants (which can have their own dedicated apps and
urlconf) and dynamic tenants. - Routing Options: Tenants can be identified and routed via URL (using subdomains or subfolders on a shared subdomain), Session, or Headers.
- Schema Usage: The
publicschema is intended strictly for shared data across all tenants, rather than main site data. The package discourages using the search path for table "overriding." - Management Commands: Supports running management commands across multiple schemas using wildcards, with options for sequential or parallel execution via multithreading.