Flask - Externally Visible Dev Server

馋奶兔 提交于 2019-12-06 06:24:59

问题


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?


回答1:


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.



来源:https://stackoverflow.com/questions/18793115/flask-externally-visible-dev-server

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!