Craig P
Craig P

Reputation: 507

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 = True

The PostgresSQL scheme segregation is working perfectly and I have created a demo tenant with host demo.localhost

enter image description here

enter image description here

I am running the server locally with

python3 manage.py runserver localhost:8000

in my browser, localhost:8000 works perfectly however the subdomain, demo.localhost:8000 is never resolved and I see no request in the terminal.

Is there something I am missing or logs I can check to try and troubleshoot?

Upvotes: 0

Views: 322

Answers (2)

Tané
Tané

Reputation: 156

Localhost is not a domain, it just refer to your computer. So It won't resolve any subdomain.

You could try it to add a custom domain to the /etc/hosts file:

127.0.0.1 mycustomdomain.com subdomain.mycustomdomain.com

And try again, but replace localhost with your new domain in the configurations.

Upvotes: 0

Craig P
Craig P

Reputation: 507

after a day of troubleshooting, the problems seems to be with Safari. Using Edge I am able to browse to a subdomain

Upvotes: 1

Related Questions