Search code examples
restapiweb-deploymentwindows-server-2012flask-restful

How to expose a Flask local development(default) server to the public on windows server


I have a flask app running on a remote WINDOWS server (this server has a fixed ip address) which is not on my local network. The flask app is used to return some json data. The app works fine when I try to access the data while being logged into the remote server through request module in Python. However, when I try to run the same script on my personal laptop (which is not on the same network as the remote windows server), I get an error. However, when I try to ping the remote server from windows command prompt, I get the answer back. Can somebody tell in which direction should I go? I have no experience with web / api development.

    response = requests.get("http://127.0.0.1:5000/product/1)

But instead of the local ip address, if I substitute the remote ip address, I don't get anything back.


Solution

  • Ok, so the problem lied with the remote firewall, it was blocking incoming connections. The moment I switched off the firewall, everything started working.