You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
- import pathlib
-
- from pydantic_settings import BaseSettings
-
- root = pathlib.Path(__file__).parent
- # This will always give the correct path as long as .env is in the parent directory
- env_file = root / '.env'
-
-
- class Settings(BaseSettings):
-
- project_root: pathlib.Path = root
- secret: str =""
- db_uri: str = "sqlite+pysqlite:///app.db"
- token_url: str = "/auth/login"
-
- class Config:
- _env_file = '.env'
-
-
- Config = Settings(_env_file=env_file)
-
-
-
- print(Settings().dict())
|