From b04b0ba9235c1a21bf6fd42d3ceab4b8938f4dd2 Mon Sep 17 00:00:00 2001 From: magowiz Date: Sat, 4 Dec 2021 18:24:09 +0100 Subject: [PATCH] add initial configuration, replace get_configuration with toml.load to avoid validation error on aerich init --- aerich.ini | 5 +++++ mobilizon_reshare/aerich_conf/database.py | 8 ++++---- 2 files changed, 9 insertions(+), 4 deletions(-) create mode 100644 aerich.ini diff --git a/aerich.ini b/aerich.ini new file mode 100644 index 0000000..56b62ce --- /dev/null +++ b/aerich.ini @@ -0,0 +1,5 @@ +[aerich] +tortoise_orm = mobilizon_reshare.aerich_conf.database.TORTOISE_ORM +location = ./migrations +src_folder = ./. + diff --git a/mobilizon_reshare/aerich_conf/database.py b/mobilizon_reshare/aerich_conf/database.py index 5afa788..dd6e295 100644 --- a/mobilizon_reshare/aerich_conf/database.py +++ b/mobilizon_reshare/aerich_conf/database.py @@ -1,11 +1,11 @@ """tortoise orm conf for aerich""" from pathlib import Path -from mobilizon_reshare.config.config import get_settings +import toml -CONF_FILE = "settings.toml" +CONF_FILE = "mobilizon_reshare/settings.toml" -SETTINGS = get_settings(CONF_FILE) -db_path = Path(SETTINGS.db_path) +SETTINGS = toml.load(CONF_FILE) +db_path = Path(SETTINGS['default']['db_path']) db_url = f"sqlite:///{db_path}"