问题
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