25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.
 
 
 
 

26 satır
492 B

  1. import pathlib
  2. from pydantic_settings import BaseSettings
  3. root = pathlib.Path(__file__).parent
  4. # This will always give the correct path as long as .env is in the parent directory
  5. env_file = root / '.env'
  6. class Settings(BaseSettings):
  7. project_root: pathlib.Path = root
  8. secret: str =""
  9. db_uri: str = "sqlite+pysqlite:///app.db"
  10. token_url: str = "/auth/login"
  11. class Config:
  12. _env_file = '.env'
  13. Config = Settings(_env_file=env_file)
  14. print(Settings().dict())