0

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?

Craig P
  • 477
  • 6
  • 12

2 Answers2

1

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

Craig P
  • 477
  • 6
  • 12
0

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.

Tané
  • 156
  • 6