diff options
Diffstat (limited to 'settings.py')
| -rw-r--r-- | settings.py | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/settings.py b/settings.py new file mode 100644 index 0000000..2daff90 --- /dev/null +++ b/settings.py | |||
| @@ -0,0 +1,19 @@ | |||
| 1 | from pathlib import Path | ||
| 2 | |||
| 3 | from pydantic_settings import BaseSettings | ||
| 4 | |||
| 5 | |||
| 6 | class Env(BaseSettings): | ||
| 7 | token: str | ||
| 8 | proxy: str | None = None | ||
| 9 | |||
| 10 | |||
| 11 | database_path = Path("./storage/database.db").absolute() | ||
| 12 | database_path.parent.mkdir(parents=True, exist_ok=True) | ||
| 13 | database_url = f"sqlite+aiosqlite:///{database_path}" | ||
| 14 | |||
| 15 | __all__ = [ | ||
| 16 | "database_path", | ||
| 17 | "database_url", | ||
| 18 | "Env", | ||
| 19 | ] | ||
