You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 10, 2020. It is now read-only.
Repository navigation
This repository was archived by the owner on Mar 10, 2020. It is now read-only.
Server command ignores some values in config associated with app #108
Running the below code with Flask 0.10.1 and Flask-Script 2.0.5 will result in a server starting at port 5000, though the app is explicitly configured to use port 8888. To the end user, the SERVER_NAME configuration value appears to be ignored.
I'm not sure if this behavior merits changing. However, I think it should be documented, since it is confuses the end user when certain configuration values (e.g. SERVER_NAME) appear to be ignored.
This seems to have been fixed at some point, although Flask requires SERVER_NAME to be a string, setting it to an int throws an exception in Flask, setting it without a host makes it be ignored.
with default values for host, port, etc... This overrides all the normal flask configuration environment variables, which is pretty frustrating to work around.
In case anyone else lands on this, I've found a workaround that works in the specific case of SERVER_NAME, which is simply to make my own runserver command that goes back to providing Nones for host= and port= like so:
Activity
nfvs commentedon Dec 10, 2014
This seems to have been fixed at some point, although Flask requires
SERVER_NAMEto be a string, setting it to an int throws an exception in Flask, setting it without a host makes it be ignored.tdeck commentedon Jul 26, 2015
I am just starting with Flask-Script and am experiencing the same issue. It looks like runserver calls
app.runlike this:with default values for host, port, etc... This overrides all the normal flask configuration environment variables, which is pretty frustrating to work around.
tdeck commentedon Jul 27, 2015
In case anyone else lands on this, I've found a workaround that works in the specific case of
SERVER_NAME, which is simply to make my own runserver command that goes back to providingNones forhost=andport=like so:This will cause Flask to use whatever fallback it chooses, which will be the environment, then Flask's own internal defaults.
ariscn commentedon Oct 21, 2015
+1, just bit by this.
Thanks for the workaround, @tdeck!