Can't connect to Flask web service, connection refused

前端 未结 7 2179
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 18:38

    app.run(host='0.0.0.0',port=5000)
    

    if you run your app in this way then your server will be visible externally. Steps by Setp:

    1. Run your app by using the following command

      app.run(host='0.0.0.0',port=5000)

    2. Go to the window cmd . Type ipconfig and get the get the IPV4 adress suppose your IPV4 address is 192.168.X.X

    3. Go to the mobile browser and type the 192.168.X.X:5000

提交回复
热议问题