Yashar Yashar - 1 year ago 566
Python Question

Can't connect to Flask web service, connection refused

I'm trying to run a simple web server on a Raspberry Pi with Flask. When I run my Flask app, it says:

running on

But when I enter this address on my laptop's in Chrome, I get


I can open on the Raspberry Pi's browser. What do I need to do to connect from another computer?

Answer Source

Run your app like this:

if __name__ == '__main__':

It will make the server externally visible. If the IP address of the machine is 192.168.X.X then, from the same network you can access it in 5000 port. Like, http://192.168.X.X:5000

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download