Flask - 外部可见开发服务器 [英] Flask - Externally Visible Dev Server
问题描述
Flask文档描述了一个外部可见的服务器,允许用户在您的网络上访问您的运行应用程序。该文件似乎假设了一个我不拥有的理解水平,我不知道如何使它的工作。
我调整了我的 app.run()
方法,按照文档中的指示向它传递 host ='0.0.0.0'
/ p>
我的网络中的用户如何访问我的应用程序?他们访问什么地址?是否需要配置其他设置?
您应该能够访问它: 0.0.0.0:port
。
您的网络上有人可以通过 your-local-ip访问它:端口
。
根据您的系统,可以找到您本地的IP地址,但应该看起来像 192.168.XX
。
The Flask docs describe an externally visible server that allows users on your network to access your running app. The docs seem to assume a level of understanding that I don't possess and I can't figure out how to make it work.
I've adjusted my app.run()
method, passing it the host='0.0.0.0'
argument, as instructed in the docs.
How does a user in my network access my app? What address do they visit? Do other settings need to be configured?
You should be able to access it by going to: 0.0.0.0:port
.
Someone on your network can access it by going to your-local-ip:port
.
Depending on your system, there is a way of finding your local IP address, but it should look something like 192.168.X.X
.
这篇关于Flask - 外部可见开发服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!