Buckets:
AnonymousSpottedToad/candidate_bucket / codebase /python /sustainability-software-lab_ca-biositing /config.py
| from functools import lru_cache | |
| from pydantic_settings import BaseSettings, SettingsConfigDict | |
| class Settings(BaseSettings): | |
| """ | |
| Defines the application settings, loaded from environment variables. | |
| """ | |
| # This is the only setting our application code currently needs. | |
| # Pydantic will automatically find this variable in the .env file. | |
| DATABASE_URL: str | |
| # Configure Pydantic to: | |
| # 1. Look for a .env file. | |
| # 2. Ignore extra variables found in the .env file (like POSTGRES_USER etc.) | |
| # This resolves the ValidationError. | |
| model_config = SettingsConfigDict(env_file=".env", extra='ignore') | |
| def get_settings() -> Settings: | |
| """ | |
| Returns a cached instance of the Settings object. | |
| Using lru_cache ensures the .env file is read only once. | |
| """ | |
| return Settings() | |
Xet Storage Details
- Size:
- 833 Bytes
- Xet hash:
- fefb9d614a8c1e5a435c708c585245e3a31be2e171abc35e686c0c3bab75b4b2
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.