Registry / web-framework / django-tenant-users

django-tenant-users

JSON →
library2.2.1pypypiunverified

Extends django-tenants to add global multi-tenant user support, allowing users to belong to multiple tenants with per-tenant permissions. Current version 2.2.1, requires Python >=3.9, compatible with Django 4.2+, s. Release cadence: irregular, ~3-4 minor versions per year.

pip install django-tenant-users
INSTALL
IMPORT
SIG · DJANGO-TENANT-USER
D
django-tenant-users
web-frameworkpythonv2.2.1
Install
3.6s avg
Import
Disk
68MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v2.2.1 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 69.2MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 3.6s · import 0.000s · 70MB
68MB installed
● package 68MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

UserTenantPermissions
from tenant_users.permissions.models import UserTenantPermissions
from tenant_users.permissions.models import UserTenantPermissions

Minimal setup: add 'tenant_users' to INSTALLED_APPS and include tenant URLs.

# settings.py INSTALLED_APPS = [ ... 'tenant_users', 'django_tenants', # required dependency ] # urls.py from django.urls import include, path from tenant_users.tenants.urls import get_tenant_urls urlpatterns = [ path('tenant/', include(get_tenant_urls())), ] # Create a tenant user (shell) # from tenant_users.tenants.models import User # u = User.objects.create_user(email='user@example.com', password='secret', is_active=True) # tenant = Tenant.objects.create(name='My Tenant', schema_name='my_tenant') # u.add_tenant(tenant, is_admin=True)
Debug
Known issues
breakingIn v2.0, import paths changed significantly. All models and utilities formerly in 'tenant_users.models' are now split into submodules (e.g., 'tenant_users.tenants.models', 'tenant_users.permissions.models').
fix
Update imports: from tenant_users.tenants.models import TenantUserMixin, from tenant_users.permissions.models import UserTenantPermissions.
affects: >=2.0.0
breakingprovision_tenant utility function now returns the created tenant (v2.0.0). Previously it returned nothing.
fix
Update code that calls provision_tenant to use the returned tenant object.
affects: >=2.0.0
gotchaUserTenantPermissions caching bug in remove_user (fixed in v2.1.2) could cause stale permissions after user removal from a tenant.
fix
Upgrade to v2.1.2 or later.
affects: <2.1.2
gotchaschema_required decorator in v2.1.2 and earlier had a bug related to connection state restoration (fixed in v2.1.3).
fix
Upgrade to v2.1.3 or later.
affects: >=2.0.0,<2.1.3
Upgrade
Version history
2.2.1latest on PyPI · released Oct 8, 2025
Audit
Dependencies

No dependency data recorded yet.

Agent activity
24 hits · last 30 days
node
22
OpenAI (training)
1
Resources
django-tenant-users — pip install django-tenant-users · libregistry