External config supported

We are using standard Flask feature for uploading external
configuration

Change-Id: I6526a9014e51c761ca6841984062004ae4dc3afb
Closes-Bug: #1583117
This commit is contained in:
Alexander Kislitsky 2016-05-20 14:09:49 +03:00
parent 97890f10d6
commit 656f77ac40
1 changed files with 2 additions and 0 deletions

View File

@ -295,6 +295,8 @@ def build_app():
app.url_map.converters.update(converters.ALL)
api.init_app(app) # init_app spoils Api object if app is a blueprint
app.config["SQLALCHEMY_TRACK_MODIFICATIONS"] = False # silence warning
# TUNINGBOX_SETTINGS is the path to the file with tuning_box configuration
app.config.from_envvar('TUNINGBOX_SETTINGS', silent=True)
# These handlers work if PROPAGATE_EXCEPTIONS is on (Nailgun case)
app.register_error_handler(sa_exc.IntegrityError, handle_integrity_error)
db.db.init_app(app)