Coverage for app / core / config.py: 100%

19 statements  

« prev     ^ index     » next       coverage.py v7.13.5, created at 2026-05-05 17:54 +0000

1from functools import lru_cache 

2 

3from pydantic_settings import BaseSettings, SettingsConfigDict 

4 

5 

6class Settings(BaseSettings): 

7 model_config = SettingsConfigDict( 

8 env_file=".env", 

9 env_file_encoding="utf-8", 

10 extra="ignore", 

11 ) 

12 

13 environment: str = "development" 

14 

15 # Database 

16 database_url: str 

17 sync_database_url: str 

18 

19 # Redis / Celery 

20 redis_url: str 

21 

22 # Supabase Auth 

23 supabase_url: str | None = None 

24 supabase_service_key: str | None = None 

25 

26 # SMTP / Alerts 

27 smtp_host: str = "localhost" 

28 smtp_port: int = 1025 

29 smtp_user: str | None = None 

30 smtp_pass: str | None = None 

31 from_email: str = "alerts@uptime-monitor.local" 

32 

33 

34@lru_cache 

35def get_settings() -> Settings: 

36 return Settings() 

37 

38 

39settings = get_settings()