Skip to content Skip to sidebar Skip to footer

Redirect To Tenant Domain After Signup With Django-tenants?

I'm using a django-tenants library where each tenant is a separate, isolated postgres schema. The django tenants module does a lot of the heavy lifting and I've got the following c

Solution 1:

I am the maintainer of Django Tenant. As the tenants can take some time to setup I suggest you use celery to create the tenant. Once the tenant is setup I would send the user an email to verify their account / tenant which take them to their tenant.

Solution 2:

I solved the problem this way.

subdomain = form.cleaned_data["subdomain"]
host = request.META.get('HTTP_HOST', '')
scheme_url = request.is_secure() and"https"or"http"
url = f"{scheme_url}://{subdomain}.{host}"return HttpResponseRedirect(url)

Post a Comment for "Redirect To Tenant Domain After Signup With Django-tenants?"