reorder config imports for more specific overrides

This commit is contained in:
2020-03-07 19:37:02 -06:00
parent 5f5301e9c9
commit ab009e4f59
3 changed files with 19 additions and 7 deletions

View File

@@ -17,12 +17,11 @@ def create_app(instance_path=None, test_config=None):
# if it doesn't already exist, create the instance folder
os.makedirs(app.instance_path, exist_ok=True)
if test_config is None:
# load defaults from config provided with the application
app.config.from_object('incorporealcms.config.Config')
# load specific instance configurations
app.config.from_pyfile('config.py', silent=True)
else:
# load defaults from config provided with the application
app.config.from_object('incorporealcms.config.Config')
# load specific instance configurations
app.config.from_pyfile('config.py', silent=True)
if test_config:
app.config.from_mapping(test_config)
dictConfig(app.config['LOGGING'])