I have 2 containers. one with django app and other with flask app.
From django app view, I’m calling rest api [rest api inside flask app] in this way.
django view
def view(request)
r = requests.get(‘http://ip:5000’)
But I am getting error ’ (‘Connection aborted.’, error(113, ‘No route to host’))’
But if I call the same rest api from plain python file(external from docker). It runs fine. snip below
##snip
python testflask.py
Hello World! I have been seen 58 times.
##snip
For django container, I have a Dockerfile and docker-compose.yml file [web + postgres]. I run this using the docker-compose up. I know basically docker-compose builds and runs the images.
For Flask, I also have a Dockerfile and docker-compose.yml file[flask+redis]. I run this using the docker-compose up command.
Inside the view of django app, I make a http request to this flask api.