Do not set app.config['SERVER_NAME'] if app_context exists.

This commit is contained in:
Jan Kaluza
2018-03-20 14:39:55 +01:00
committed by mprahl
parent 5b278211e6
commit bf873dbaea

View File

@@ -132,7 +132,8 @@ def make_session(conf):
return
# Needs to be set to create app_context.
if 'SERVER_NAME' not in app.config or not app.config['SERVER_NAME']:
if (not has_app_context() and
('SERVER_NAME' not in app.config or not app.config['SERVER_NAME'])):
app.config['SERVER_NAME'] = 'localhost'
# If there is no app_context, we have to create one before creating