Can't connect to Flask web service, connection refused

前端 未结 7 2154
Happy的楠姐
Happy的楠姐 2020-12-08 18:06

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 http://127.0.0.1:5000/

相关标签:
7条回答
  • 2020-12-08 19:02

    Run your app like this:

    if __name__ == '__main__':
        app.run(host='0.0.0.0')
    

    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

    0 讨论(0)
提交回复
热议问题