make applying config values more robust
This commit is contained in:
parent
1111a35f3d
commit
c295651d83
@ -15,11 +15,11 @@ def create_app(config=None):
|
|||||||
app.config['DEBUG_TB_INTERCEPT_REDIRECTS'] = False #DEBUG
|
app.config['DEBUG_TB_INTERCEPT_REDIRECTS'] = False #DEBUG
|
||||||
|
|
||||||
# use config from function parameter if present
|
# use config from function parameter if present
|
||||||
if config is not None:
|
if config:
|
||||||
app.config.from_object(config)
|
app.config.update(config)
|
||||||
|
|
||||||
# some #DEBUG output
|
# some #DEBUG output
|
||||||
print(f"Current Environment: {app.config['ENV']}") #DEBUG
|
print(f"Current Environment: {app.config['ENV'] if 'ENV' in app.config.keys() else 'ENV is not set'}") #DEBUG
|
||||||
print(app.config) #DEBUG
|
print(app.config) #DEBUG
|
||||||
|
|
||||||
# initialize database
|
# initialize database
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user