Solve the problem that Flask's web page cannot be accessed in the local area network

The web page written using the flask framework can be accessed normally using http://127.0.0.1:5000/ locally, but the host in the same LAN cannot be accessed using the server IP. The solutions are as follows:
1. Turn off the local firewall.
Insert picture description here
2. Set Flask to be accessible from any address, host is set to '0.0.0.0'

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

Guess you like

Origin blog.csdn.net/qq_44371305/article/details/105317072