Allow instance/config and/or config/testing to override default config
This commit is contained in:
parent
b844300e44
commit
0e7f12545c
|
@ -42,6 +42,11 @@ def setup_config(app: Flask) -> None:
|
|||
|
||||
app.config["SQLALCHEMY_TRACK_MODIFICATIONS"] = False
|
||||
app.config.from_object("spiffworkflow_backend.config.default")
|
||||
# This allows config/testing.py or instance/config.py to override the default config
|
||||
if 'ENV' in app.config and app.config['ENV'] == 'testing':
|
||||
app.config.from_pyfile('config/testing.py', silent=True)
|
||||
else:
|
||||
app.config.from_pyfile(f'{app.instance_path}/config.py', silent=True)
|
||||
|
||||
setup_database_uri(app)
|
||||
setup_logger(app)
|
||||
|
|
Loading…
Reference in New Issue