-
-
Notifications
You must be signed in to change notification settings - Fork 16.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
app.run(host, port) and SERVER_NAME should correspond to where flask is actually running #2109
Comments
0.0.0.0:5000 is not a valid server name. It's a valid bind, but that's not what |
This won't (a cannot due to lazy loading) apply to the |
Seems like this should be closed based on above comments? |
Yes. Also, server name isn't necessarily the same as the local address the server is bound to. |
How can I make 2 server names? |
Is there any way of putting the For example, defining a configuration file and having these variables inside of it, instead of defining these exactly on
|
add www record in you DNS settings so when anyone type www.example.com it automatically redirect to your website |
change port use flask run --host 0.0.0.0 |
Assuming the SERVER_NAME config variable is configured as '0.0.0.0:5555':
In both cases the SERVER_NAME config variable does not correspond to where flask is actually running.
The host and port parameters in app.run() must of course take precedence, but should be set according to the SERVER_NAME config variable if present.
The current implementation in app.run():
Could be replaced by the following:
The following can be used to make sure the SERVER_NAME config variable corresponds to where flask is actually running:
The text was updated successfully, but these errors were encountered: