django-tenant-schemas
django-tenant-schemas copied to clipboard
How can be executed a tenant command that be executed in all Tenants.
trafficstars
Actually, I need to specify a tenant name.
I want to execute a script that populates some models data for all tenants. No just one.
See https://django-tenant-schemas.readthedocs.io/en/latest/use.html#tenant_context
from tenant_schemas.utils import tenant_context
for tenant in Tenant.objects.all():
with tenant_context(tenant):
# do stuff in each tenant
Thank you so much!