Middleware¶
The core of django-tenants-url
is the custom MIDDLEWARE
.
Table of Contents¶
Installation¶
- Add the
TENANT_USER_MODEL
tosettings.py
.
# settings.py
...
DTU_TENANT_USER_MODEL = 'myapp.TenantUser'
...
- Update the
MIDDLEWARE
to have the newRequestUUIDTenantMiddleware
. Preferentially at the very top.
# settings.py
...
MIDDLEWARE = [
'django_tenants_url.middleware.RequestUUIDTenantMiddleware',
'django.middleware.security.SecurityMiddleware',
...
]
...