网络中的远程计算机无法访问Python Flask应用程序 [英] Python Flask application cannot be accessed by remote computers in network

查看:182
本文介绍了网络中的远程计算机无法访问Python Flask应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在本地主机上运行了一个简单的jar web应用程序。


$ b web应用程序运行在127.0.0.1:8000上。但是我无法使用myHostComputerIPaddress:8000从我的网络中的远程机器访问它。



我的主机是一台Windows机器。请指教。

解决方案您的 app.run()函数必须是 app.run(host ='0.0.0.0'),以便访问同一网络上的其他设备。


I ran a simple flask web application on python on my localhost.

The web application is running on 127.0.0.1:8000. But I cannot access it from a remote machine in my network using myHostComputerIPaddress:8000.

My host is a windows machine. Please advise.

解决方案

Your app.run() function must be app.run(host='0.0.0.0') in order to give access other devices on same network.

这篇关于网络中的远程计算机无法访问Python Flask应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆