在this教程之后,我将学习如何使用virtualenv
和flask
创建restfulpython服务
我创建了一个小的hello world
web应用程序并执行它:./app.py
。
这导致:
* Running on http://127.0.0.1:5000/
* Restarting with reloader
但是当我打开浏览器并输入http://<external ip>:5000
,而不是看到hello world时,我得到:
could not connect to <external ip>:5000
我错过了什么?在
以下信息清楚地说明了您所缺少的:
服务器只监听
^{pr2}$localhost
地址,因此它看不到来自其他计算机的连接。如果要使服务器侦听公共接口,则需要按如下方式更改app.run()
行:相关问题 更多 >
编程相关推荐