{"categories":[{"label":"Python Modules","url":"https://skillfed.io/packages/category/software-development-libraries-python-modules/8"}],"enrichment":{"capability":"Enables Django applications to serve multiple tenants from a single instance using PostgreSQL schemas, where each tenant's data is isolated in its own schema while sharing the application code.","skillfed_tags":["multitenancy","saas","postgresql"],"use_cases":["Build a SaaS platform where each customer's data must be isolated but served from a single Django instance","Implement different views or configurations per tenant while reusing the same codebase and database connection pool","Manage shared data (e.g., billing, user accounts) in the public schema while keeping customer-specific tables in tenant schemas","Scale horizontally by running multiple application instances against the same PostgreSQL database with automatic tenant routing"],"what_it_does":"django-tenants is a Django extension that implements the semi-isolated multitenancy pattern: one PostgreSQL database with separate schemas per tenant. It intercepts requests by hostname, routes them to the correct tenant schema, and makes all ORM queries operate transparently within that schema without requiring changes to your view code. The package manages schema creation, migration routing (shared vs. tenant-specific), and provides middleware to automatically set the PostgreSQL search path on each request.\n\nYou define a tenant model (e.g., Client) and a domain model to map hostnames to tenants. When a request arrives at tenant.example.com, the middleware looks up the tenant, sets the schema, and all subsequent database operations happen in that tenant's isolated space. This approach balances simplicity\u2014minimal code changes needed\u2014with performance benefits of shared connections and buffers compared to fully separate databases.","worth_installing":"Yes. django-tenants is production-stable (Development Status 5), actively maintained, has no known vulnerabilities, and solves a real architectural problem for SaaS applications. The single django dependency and permissive MIT license remove friction. Install if you need schema-based multitenancy on PostgreSQL; it requires Django 2+ and PostgreSQL, and you must be comfortable with PostgreSQL schema concepts."},"id":"django-tenants","links":{"html":"https://skillfed.io/packages/django-tenants","md":"https://skillfed.io/packages/django-tenants.md","pypi":"https://pypi.org/project/django-tenants/"},"maintenance":{"status":"active"},"meta":{"latest_release":"2026-08-05","license_spdx":"MIT","license_treatment":"permissive","name":"django-tenants","python_support":"supports_current","summary":"Tenant support for Django using PostgreSQL schemas."},"popularity":{"monthly_downloads":958398,"position":4641,"tier":"top_5000"},"security":{"n_vulnerabilities":0},"version":"3.14.0"}
