From ac0f5c4549daec974a2ff4d9809ca84602e444a6 Mon Sep 17 00:00:00 2001 From: Lili Date: Fri, 23 Sep 2022 11:49:32 +0200 Subject: [PATCH] make db config work in instance dir when package --- tlapbot/__init__.py | 3 +++ tlapbot/default_config.py | 1 - 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/tlapbot/__init__.py b/tlapbot/__init__.py index 20d0995..526e8d7 100644 --- a/tlapbot/__init__.py +++ b/tlapbot/__init__.py @@ -6,6 +6,9 @@ from tlapbot.owncast_helpers import is_stream_live, give_points_to_chat def create_app(test_config=None): app = Flask(__name__, instance_relative_config=True) + app.config.from_mapping( + DATABASE=os.path.join(app.instance_path, "tlapbot.sqlite") + ) app.config.from_object('tlapbot.default_config') app.config.from_pyfile('config.py') diff --git a/tlapbot/default_config.py b/tlapbot/default_config.py index c756a70..57f4d85 100644 --- a/tlapbot/default_config.py +++ b/tlapbot/default_config.py @@ -1,5 +1,4 @@ SECRET_KEY='dev' -DATABASE='./instance/tlapbot.sqlite' OWNCAST_ACCESS_TOKEN='' OWNCAST_INSTANCE_URL='http://localhost:8080' POINTS_CYCLE_TIME=600