This site can’t be reached [flask, python]

In general, this message

Running on http://0.0.0.0:5000/ (Press CTRL+C to quit)

informs you about the IP-address of your PC that will be listened to accept the request. It can be configured to listen to only one IP-address.

As it has been stated in the comments, if you are trying to reach your Web site from the same PC you develop on, you may use virtual (loop) address 127.0.0.1. In case you want to check how your Web site will look on your other devices that are connected to the same network (i.e. tablet, phone, other PC whatever else), you need to type your PC's internal network IP address, and it differs from the loop. It may be e.g. 192.168.1.1 (you should check it on your NIC properties). And it may changes if you try to make something like live-demo to your friends.

So in order, to prevent you from checking each time, which one IP-address is valid for your PC right now, you can use 0.0.0.0 telling to your application 'listen for incoming requests from ALL the NICs, whatever IP-address they have'.


For me using app.run(debug=False) worked when using

port = int(os.environ.get('PORT', 5000))
app.run(host='0.0.0.0', port=port)

did not.

I can't tell if this is a firewall issue or why it didn't work. Do note that after doing this it started hosting at http://127.0.0.1:5000/.