mirror of
https://github.com/Tech-Workers-Coalition-Italia/mobilizon-reshare.git
synced 2025-01-30 00:55:13 +01:00
add initial configuration, replace get_configuration with toml.load to avoid validation error on aerich init
This commit is contained in:
parent
653d98e076
commit
b04b0ba923
5
aerich.ini
Normal file
5
aerich.ini
Normal file
@ -0,0 +1,5 @@
|
||||
[aerich]
|
||||
tortoise_orm = mobilizon_reshare.aerich_conf.database.TORTOISE_ORM
|
||||
location = ./migrations
|
||||
src_folder = ./.
|
||||
|
@ -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}"
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user