* Serving Flask app "app" (lazy loading) * Environment: production WARNING: Donot use the development serverin a production environment. Use a production WSGI serverinstead. * Debug mode: on * Restarting with stat * Debugger is active! * Debugger PIN: 228-080-042 * Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
除本机外是不能访问的,需要在run参数中设置,端口自定,主机为0.0.0.0
1
app.run(host='0.0.0.0', port=5000)
再次启动后就可以了。
1 2 3 4 5 6 7 8 9
* Serving Flask app "app" (lazy loading) * Environment: production WARNING: Donot use the development serverin a production environment. Use a production WSGI serverinstead. * Debug mode: on * Restarting with stat * Debugger is active! * Debugger PIN: 228-080-042 * Running on http://0.0.0.0:5000/ (Press CTRL+C to quit)