mirror of
https://github.com/Tech-Workers-Coalition-Italia/mobilizon-reshare.git
synced 2025-02-06 04:13:27 +01:00
add aerich configuration
This commit is contained in:
parent
1f27f2f78c
commit
653d98e076
0
mobilizon_reshare/aerich_conf/__init__.py
Normal file
0
mobilizon_reshare/aerich_conf/__init__.py
Normal file
23
mobilizon_reshare/aerich_conf/database.py
Normal file
23
mobilizon_reshare/aerich_conf/database.py
Normal file
@ -0,0 +1,23 @@
|
||||
"""tortoise orm conf for aerich"""
|
||||
from pathlib import Path
|
||||
from mobilizon_reshare.config.config import get_settings
|
||||
|
||||
CONF_FILE = "settings.toml"
|
||||
|
||||
SETTINGS = get_settings(CONF_FILE)
|
||||
db_path = Path(SETTINGS.db_path)
|
||||
|
||||
db_url = f"sqlite:///{db_path}"
|
||||
|
||||
TORTOISE_ORM = {
|
||||
"connections": {"default": db_url},
|
||||
"apps": {
|
||||
"models": {
|
||||
"models": ["mobilizon_reshare.models.event",
|
||||
"mobilizon_reshare.models.notification",
|
||||
"mobilizon_reshare.models.publication",
|
||||
"mobilizon_reshare.models.publisher", "aerich.models"],
|
||||
"default_connection": "default",
|
||||
},
|
||||
},
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user