Open rzrwolf opened 1 year ago
Further to above - using HTTPIE from console - gives same error
http http://demo.localhost:9000/patients/patients
http: error: gaierror: [Errno 11001] getaddrinfo failed
http http://demo.localhost:9000/
http: error: gaierror: [Errno 11001] getaddrinfo failed
Couldn’t resolve the given hostname. Please check the URL and try again.
Does it mean that subdomain is not resolved as address?
What am i doing wrong?
I spent almost 8 hours to fix it and now - i got the issue - for some reason browser resolves wildcard subdomains from address string, but Windows fails to do so for pycharm and python..
I have edited the HOSTS file adding the subdomains
127.0.0.1 demo.localhost
127.0.0.1 revital.localhost
127.0.0.1 localhost
And guess what? API and everything WORKS as expected...
How do i deal with tenant wildcard subdomains in Django and not just list them in HOSTS file?
Any ideas / working solutions?
Does this happen with Linux distros?
Hello!
I am trying to build some service app with django tenants and REST api
I am getting an error when trying to access API ..
For example if directly enter URL
http://demo.localhost:9000/api/zakaz/2/
- i get correct API viewBut if i am trying to access the same address from the Api call - i get the following error:
HTTPConnectionPool(host='demo.localhost', port=9000): Max retries exceeded with url: /api/zakaz/2/ (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x00000222A0947160>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed'))
Basically app can not connect to API in code by using tenant domain as API URL as far as i understand..
How this can be solved ?
This is Settings file i use:
The tenant url.py is as follow:
API url.py