From 29157dbc03897e0e170aab931d0a27e168dd1383 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20Gr=C3=B6ger?= Date: Wed, 10 Feb 2021 21:21:53 +0100 Subject: [PATCH] [config] add port-config for database --- flaschengeist/config.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/flaschengeist/config.py b/flaschengeist/config.py index 09ada68..089dab9 100644 --- a/flaschengeist/config.py +++ b/flaschengeist/config.py @@ -9,7 +9,7 @@ from flaschengeist import _module_path, logger # Default config: -config = {} +config = {"DATABASE": {"port": 3306}} def update_dict(d, u): @@ -66,11 +66,12 @@ def configure_app(app, test_config=None): app.config["SECRET_KEY"] = config["FLASCHENGEIST"]["secret_key"] if test_config is None: - app.config["SQLALCHEMY_DATABASE_URI"] = "mysql://{user}:{passwd}@{host}/{database}".format( + app.config["SQLALCHEMY_DATABASE_URI"] = "mysql://{user}:{passwd}@{host}:{port}/{database}".format( user=config["DATABASE"]["user"], passwd=config["DATABASE"]["password"], host=config["DATABASE"]["host"], database=config["DATABASE"]["database"], + port=config["DATABASE"]["port"], ) else: app.config["SQLALCHEMY_DATABASE_URI"] = f"sqlite+pysqlite://{config['DATABASE']['file_path']}"