我是靠谱客的博主 爱笑可乐,这篇文章主要介绍python怎么启动80端口,如何让Flask在80端口上运行?,现在分享给大家,希望可以做个参考。

I have a Flask server running through port 5000, and it's fine. I can access it at http://example.com:5000

But is it possible to simply access it at http://example.com? I'm assuming that means I have to change the port from 5000 to 80. But when I try that on Flask, I get this error message when I run it.

Traceback (most recent call last):

File "xxxxxx.py", line 31, in

app.run(host="0.0.0.0", port=int("80"), debug=True)

File "/usr/local/lib/python2.6/dist-packages/flask/app.py", line 772, in run

run_simple(host, port, self, **options)

File "/usr/local/lib/python2.6/dist-packages/werkzeug/serving.py", line 706, in run_simple

test_socket.bind((hostname, port))

File "", line 1, in bind

socket.error: [Errno 98] Address already in use

Running lsof

最后

以上就是爱笑可乐最近收集整理的关于python怎么启动80端口,如何让Flask在80端口上运行?的全部内容,更多相关python怎么启动80端口内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(110)

评论列表共有 0 条评论

立即
投稿
返回
顶部