Questions tagged [django-tenants]
37 questions
6
votes
2 answers
django-tenants: Python shell with specific tenant
I want to use "./manage.py shell" to run some Python commands with a specific tenant, but the code to do so is quite cumbersome because I first have to look up the tenant and then use with tenant_context(tenant)): and then write my code into this…

daniel kullmann
- 13,653
- 8
- 51
- 67
1
vote
0 answers
FastTenantTestCase : Exception: Can't create tenant outside the public schema. Current schema is fast_test #938
Trying to run test cases using FastTenantTestCase, following are the package versions:
django - 3.2.16
django-tenants - 3.3.4
Sample code:
from django_tenants.test.cases import FastTenantTestCase
class…

Mech.py
- 11
- 1
1
vote
0 answers
django-tenants postgis with multischema
How can i install postgis extension for 2 shema? shema_1 and shema_2,
my commands:
CREATE SCHEMA IF NOT EXISTS shema_1 AUTHORIZATION admin;
CREATE SCHEMA IF NOT EXISTS shema_2 AUTHORIZATION admin;
SET search_path = shema_1, shema_2, public;
CREATE…

Kirill
- 43
- 4
1
vote
0 answers
How to programatically run custom command for specific schema using django-tenants?
I am new with django-tenants. I want to programatically run a cummand I have created with management.call_command() but I am getting error. Can someone help me with this?
This command runs without error. I want to achieve same…

stackuser
- 57
- 4
1
vote
0 answers
Django tenant based users
Scenerio:
A global user can visit any tenant
Different tenant will create different user of their own password
A general user can create account in different tenant with different password
Tenant superuser can create their own group with…

Russell
- 1,624
- 5
- 23
- 43
1
vote
1 answer
How to run migrations for a specific tenant/schema in Django multi-tenant framework?
The tenant_command was not working properly according to my requirements.
So, I found out this solution after tweaking the command below
python3 manage.py tenant_command migrate --schema=schema_name

Chetan Vashisth
- 438
- 4
- 14
0
votes
0 answers
Configure django-tenants to write and read from AzureStorage
As per the django-tenants docs for file handling. I've done everything but if i include this line.
DEFAULT_FILE_STORAGE = "django_tenants.files.storage.TenantFileSystemStorage"
This will use local file storage path for storage. And when i checked…

jeevu94
- 477
- 4
- 16
0
votes
0 answers
How to configure nginx to serve multi-tenant django application
I would like to deploy a django application with the django-tenants library.
The project works fine locally, I can create tenants and access them via localhost:8000 and .localhost:8000
(mind that this redirects to localhost:8000/en and…

ish
- 75
- 5
0
votes
0 answers
Django tenants can't delete record from a shared model that has FK in tenant from public schema
I Have a custom user model shared between tenants and public
HAS_MULTI_TYPE_TENANTS = True
MULTI_TYPE_DATABASE_FIELD = 'type'
TENANT_TYPES = {
"public": {
"APPS": [
'django_tenants',
'clients',
…

Elabbasy00
- 628
- 9
- 21
0
votes
2 answers
Why is Django migrate command not creating tables in database for specific app?
I've an app named Attendance and it contains the following migrations applied in postgresql db.
attendance
[X] 0001_initial
[X] 0002_delete_leave
[X] 0003_alter_holiday_options_alter_shift_options
[X] 0004_delete_holiday_alter_shift_holidays
…

Ankit Tiwari
- 4,438
- 4
- 14
- 41
0
votes
1 answer
Django + Django Tenants + DRF API = http: error: gaierror: [Errno 11001] getaddrinfo failed
Can someone please help to resolve the error i am getting?
I am using django-tenants package with DRF REST API
The issue is that accessing API VIEW via browser works fine, for example:
http://demo.localhost:9000/api/zakaz
But sending requests to…

Евгений
- 1
- 1
0
votes
0 answers
django-tenat and rest_framework_simplejwt integration, error in blacklisting a token
I am using django-tenent and rest_framework_simplejwt and i had no any issue until I implemented rest_framework_simplejwt.token_blacklist then it started to give me errors like:
django.db.utils.IntegrityError: insert or update on table…

Srijan113
- 89
- 8
0
votes
1 answer
How to make django-tenants work with django-q
Django newbie here. I'm trying to make django-q work with django-tenants.
I am getting this error:
13:38:41 [Q] ERROR relation "django_q_schedule" does not exist
LINE 1: ...edule"."task", "django_q_schedule"."cluster" FROM "django_q_...
…

Valeriu
- 11
- 6
0
votes
0 answers
Django Multi-tenant postgresql and mongoDB
I implemented, PostgreSQL and MongoDB in a project. MongoDB was used to saved logs. It was working fine before adding multi-tenancy in the postgresql using django-tenants=3.5.0
I created another branch and removed the MongoDB from it. So just the…

Muhammad Afzaal
- 308
- 4
- 10
0
votes
0 answers
Issue with combining data from multiple Django apps into a single form option in admin back office
I'm a fairly novice developer, but I'm aiming to master Django by developing a multi-tenant SaaS application that lets users create their own online stores. I'm still at the beginning of the project, but I've already run into a problem that's…