diff options
Diffstat (limited to 'settings.py')
| -rw-r--r-- | settings.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/settings.py b/settings.py index 2daff90..04ba431 100644 --- a/settings.py +++ b/settings.py | |||
| @@ -8,12 +8,17 @@ class Env(BaseSettings): | |||
| 8 | proxy: str | None = None | 8 | proxy: str | None = None |
| 9 | 9 | ||
| 10 | 10 | ||
| 11 | database_path = Path("./storage/database.db").absolute() | 11 | storage_path = Path("./storage/").absolute() |
| 12 | database_path.parent.mkdir(parents=True, exist_ok=True) | 12 | storage_path.mkdir(parents=True, exist_ok=True) |
| 13 | |||
| 14 | database_path = storage_path / "database.db" | ||
| 13 | database_url = f"sqlite+aiosqlite:///{database_path}" | 15 | database_url = f"sqlite+aiosqlite:///{database_path}" |
| 14 | 16 | ||
| 17 | json_storage_path = storage_path / "storage.json" | ||
| 18 | |||
| 15 | __all__ = [ | 19 | __all__ = [ |
| 16 | "database_path", | 20 | "database_path", |
| 17 | "database_url", | 21 | "database_url", |
| 22 | "json_storage_path", | ||
| 18 | "Env", | 23 | "Env", |
| 19 | ] | 24 | ] |
