How to prevent Flask redirecting to the default port of 5000?

ぃ、小莉子 提交于 2020-01-14 07:01:14

问题


I'm trying to run a Python sample for using Microsoft Graph. It uses Flask libraries for a mini-application that can be run using the Flask's standalone web server.

I've modified the application initialization line as

APP.run(port=9999)

And it starts running successfully at http://localhost:9999/, but then after a step, it redirects to http://localhost:5000 which is problematic.

If I change the initial part of the URL in my browser to http://localhost:9999 and hit ENTER, it continues to function as expected.

How can tell Flask to "redirect to the URL with the port number I declared in APP.run"?


回答1:


Check config.py file, you have a route there with 5000 port



来源:https://stackoverflow.com/questions/48682476/how-to-prevent-flask-redirecting-to-the-default-port-of-5000

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