Skip to content
Snippets Groups Projects
Commit 062a0395 authored by Benjamin Bertrand's avatar Benjamin Bertrand
Browse files

Add config arg to create_app

Allow to easily pass config for testing
parent 5df6c9f1
No related branches found
No related tags found
No related merge requests found
...@@ -36,11 +36,12 @@ def register_cli(app): ...@@ -36,11 +36,12 @@ def register_cli(app):
app.logger.debug(f'{instance} already exists') app.logger.debug(f'{instance} already exists')
def create_app(): def create_app(config=None):
app = Flask(__name__) app = Flask(__name__)
app.config.from_object(settings) app.config.from_object(settings)
app.config.from_envvar('LOCAL_SETTINGS', silent=True) app.config.from_envvar('LOCAL_SETTINGS', silent=True)
app.config.update(config or {})
if not app.debug: if not app.debug:
import logging import logging
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment