Can someone please help to resolve the error i am getting?
I am using django-tenants package with DRF REST API
The issue is that accessing API VIEW via browser works fine, for example:
http://demo.localhost:9000/api/zakaz
But sending requests to this address via "requests" gives the error:
HTTPConnectionPool(host='demo.localhost', port=9000): Max retries exceeded with url: /api/zakaz/3/ (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x0000017E1D9FEB00>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed'))
Similarly and PING or HTTPIE request from console even to basic address "demo.localhost:9000" gives the same:
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.
Meaning that this address is only resolved in browser, but not from Django or Python console..
What am i doing wrong? How do i send api request in django-tenants separately for each tenant?
I have added rest framework to TENANT APPS:
TENANT_APPS = (
# your tenant-specific apps
'rest_framework',
'api.apps.ApiConfig',
'orders.apps.OrdersConfig',
'patients.apps.PatientsConfig',
)