Spaces:
Sleeping
Sleeping
Download app/core/config.py from hisham-cmd/VortexCommerceBackend: direct link, hf CLI and curl.
- Browser
- Download file 1.08 kB
-
https://huggingface.co/spaces/hisham-cmd/VortexCommerceBackend/resolve/main/app/core/config.py
- Command line
-
hf download hf://spaces/hisham-cmd/VortexCommerceBackend/app/core/config.py
-
curl -L -o config.py https://huggingface.co/spaces/hisham-cmd/VortexCommerceBackend/resolve/main/app/core/config.py
1.08 kB
| from pydantic_settings import BaseSettings | |
| from typing import List | |
| import os | |
| class Settings(BaseSettings): | |
| # Base directory for persistent data (e.g., /data for Hugging Face persistent storage) | |
| DATA_DIR: str = os.getenv("DATA_DIR", ".") | |
| DATABASE_URL: str = os.getenv("DATABASE_URL", f"sqlite:///{os.path.join(os.getenv('DATA_DIR', '.'), 'vortex.db')}") | |
| TURSO_AUTH_TOKEN: str = os.getenv("TURSO_AUTH_TOKEN", "") | |
| JWT_SECRET: str = "change-me-in-production" | |
| JWT_ALGORITHM: str = "HS256" | |
| ACCESS_TOKEN_EXPIRE_MINUTES: int = 30 | |
| REFRESH_TOKEN_EXPIRE_DAYS: int = 7 | |
| GOOGLE_CLIENT_ID: str = "" | |
| GOOGLE_CLIENT_SECRET: str = "" | |
| CORS_ORIGINS: str = "http://localhost:3000,http://localhost:3001,https://ofoq-commerce.vercel.app" | |
| def cors_origins_list(self) -> List[str]: | |
| return [origin.strip() for origin in self.CORS_ORIGINS.split(",")] | |
| model_config = { | |
| "env_file": ".env", | |
| "env_file_encoding": "utf-8", | |
| "extra": "ignore", | |
| } | |
| settings = Settings() | |