I have a django application which runs through docker compose on my local system on localhost:80
. I have another application which runs at localhost:3000
.
I want to access http://localhost:3000
within the django application.
While I try to access this I get the below error:
ConnectionError at / HTTPConnectionPool(host='localhost', port=3000): Max retries exceeded with URL: /render (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f1a03d7a610>: Failed to establish a new connection: [Errno 111] Connection refused'))
localhost
host name is very context-specific; in Docker it usually refers to "the current container". What are thelocalhost
s you refer to – separate Docker containers, multiple physical machines, VMs, systems running end users' browsers, something else? Are they the samelocalhost
?