Questions tagged [django-tenants]

37 questions
0
votes
1 answer

Django-tenants difference between connection.tenant and request.tenant

I am working on a multitenant Django application using django-tenants library. Getting the current tenant object can be done through one of the two ways: This can be used anywhere: from django.db import connection tenant =…
Yasser Mohsen
  • 1,411
  • 1
  • 12
  • 29
0
votes
0 answers

Best solution to integrate independent applications into a Django (& React) platform?

I have a general platform that I want to evolve. The platform is hosted on a domain like "https://www.example.com". For certain specific users, I would like to give them access to a completely independent application (several applications,…
0
votes
0 answers

How to generate different sitemap for public schema and rest of the tenants using the Django sitemap framework for a django_tenants project?

I am using django_tenants and I am planning to use Django sites framework to create sitemap for each of the tenant and the public schema. But the public schema shall have a different sitemap since its apps are different than that of the tenants. How…
0
votes
0 answers

How to use mysql database with django_tenants?

django-tenants When i run migrations for tenant i got error **Error : ** if connection.schema_name == public_schema_name: AttributeError: 'DatabaseWrapper' object has no attribute 'schema_name' I have tried to use below settings for database…
0
votes
2 answers

django_tenants not resolving subdomains

I have setup and installed django_tenants with the standard settings and middleware from the documentation and watched Tom's Youtube video. 'django_tenants.middleware.main.TenantMainMiddleware' and the option SHOW_PUBLIC_IF_NO_TENANT_FOUND =…
Craig P
  • 477
  • 6
  • 12
0
votes
0 answers

How to elegantly (wildcard) redirect from non-www and www to a specific subdomain, eg. `main` or `app`

I am not sure, if I built myself a terrible foot-gun of some sort here with my approach of redirecting any traffic from non-www/www to a subdomain (say main), which is the landing page of the service. Why I don't have the landing page and subsequent…
other
  • 93
  • 1
  • 7
0
votes
0 answers

Querying multiple schemas with django-tenants

I'm writing this question because I have doubts about how to implement a scenario that we had not foreseen for my django developed application. Basically what I need is a way to allow some types of users, depending on their role, could access data…
0
votes
0 answers

Deleting User not working due to ManyToMany fields on another app

I am using django-tenants and django_tenant_users with the following apps (settings.py): SHARED_APPS = ( 'django_tenants', 'django.contrib.contenttypes', 'tenant_users.permissions', # Defined in both shared apps and tenant apps …
Pedro Silva
  • 113
  • 7
0
votes
0 answers

Django-Tenant-User Circular Dependency Error during setup

I got issues doing the migrations after setting up django-tenant-user. Just using django-tenant was no issue. Everytime I run python manage.py migrate I get the following circular dependency…
MichaelKleine
  • 159
  • 1
  • 9
0
votes
1 answer

Django: Multi Tenancy : Override Tenant Context

I have overridden django_tenants.utils.tenant_context to activate a timezone specific to the tenant. class NewTenantContext(tenant_context): ... I can use the new context like this with ALSTenantContext(tenant): ... All this works fine for a…
0
votes
0 answers

Django-tenant : executing tenant_command on the test DB?

I am using django_tenants and I have an API to create a new tenant. In this API we initialize data in some models from fixtures. execute_from_command_line(["manage.py", "tenant_command", "loaddata", "core/fixtures/"+file, "-s", self.schema_name]) I…
Lucas
  • 271
  • 2
  • 4
  • 12
0
votes
1 answer

Django-tenants "Unable to create the django_migrations table"

An issue occurred where our production database was not getting migrated due to an error during migration. This error involved the usage of the package django-tenants, which is a fork of the django-tenant-schemas package. The error: Traceback (most…
David Alford
  • 2,044
  • 3
  • 12
  • 35
0
votes
1 answer

How to Redirect tenant to subdomain home page after user can login in public schema

I have to redirect to home page without login in subdomain after login in public tenant That means suppose - public domain is : logic.com subdomain is : tenant1.logic.com I have tried to login to the public domain (logic.com/login) so now I have to…
0
votes
0 answers

urllib [Errno 11001] getaddrinfo failed with windows proxy

I'm running Django 3.2 with django-tenants on a Windows local dev environment. In my windows hosts file I have: 127.0.0.1 *.localhost ...so that I am able to use subdomains with django-tenants. E.g. http://mysub.localhost:8000. When running…
alias51
  • 8,178
  • 22
  • 94
  • 166
0
votes
1 answer

Django multi tenant with SSO dynamically change settings variable CLIENT_ID,CLIENT_SECRET,TENANT_ID

How can i change these hardcoded ID's CLIENT_ID,CLIENT_SECRET,TENANT_ID in settings.py depending upon the tenants logged in users I had implemented django SSO using django_auth_adfs. How can i change these ID's value dynamically based on individual…
Akram
  • 958
  • 5
  • 11