bernardopires / django-tenant-schemas

Tenant support for Django using PostgreSQL schemas.
https://django-tenant-schemas.readthedocs.org/en/latest/
MIT License
1.45k stars 425 forks source link

django.contrib.admin does not work for individual tenants #575

Closed robertkowalski1974 closed 5 years ago

robertkowalski1974 commented 5 years ago

I want to set up admin module for each individual tenant. After setting everything up as per tutorial I am not able to login to /admin/. Getting error Site matching query does not exist. does django-tenant-schemas work with django.contrib.admin?

robertkowalski1974 commented 5 years ago

If you have django.contrib.sites then your default site in django_site table will be set to example.com. And then it will not work. Removing django.contrib.sites works for me.

robertkowalski1974 commented 5 years ago

So now can get to login screen, but when enter super user credential (which is kept in tenant schemas) getting relation "auth_user" does not exist error message. Why it is not picking up my users from each tenants? I am logging using tenant.domain.com/admin.