Spaces:
Sleeping
Sleeping
| from functools import lru_cache | |
| from typing import List, Union | |
| import os | |
| import cloudinary | |
| from pydantic_settings import BaseSettings | |
| class Settings(BaseSettings): | |
| app_name: str = "Marine Guard Backend" | |
| mongodb_uri: str | |
| database_name: str = "marine_guard" | |
| jwt_secret_key: str | |
| jwt_algorithm: str = "HS256" | |
| access_token_expire_minutes: int = 60 * 24 | |
| allowed_origins: Union[str, List[str]] = "http://localhost:5173" | |
| # Cloudinary settings | |
| cloudinary_cloud_name: str | |
| cloudinary_api_key: str | |
| cloudinary_api_secret: str | |
| # Hugging Face Spaces specific settings | |
| space_id: str = os.getenv("SPACE_ID", "") | |
| class Config: | |
| env_file = ".env" | |
| extra = "allow" # Allow extra fields for Hugging Face environment variables | |
| def get_settings() -> Settings: | |
| return Settings() | |