geo/backend/app/config.py

23 lines
731 B
Python

from pathlib import Path
from pydantic_settings import BaseSettings, SettingsConfigDict
_env_path = Path(__file__).resolve().parent.parent.parent / ".env"
if not _env_path.exists():
_env_path = Path(".env")
class Settings(BaseSettings):
model_config = SettingsConfigDict(env_file=str(_env_path), extra="ignore")
DATABASE_URL: str = "postgresql+asyncpg://postgres:postgres123@db:5432/geo_platform"
REDIS_URL: str = "redis://redis:6379/0"
JWT_SECRET: str = "your-secret-key-change-in-production"
JWT_EXPIRE_HOURS: int = 24
PLAYWRIGHT_BROWSERS_PATH: str = "/ms-playwright"
ZHIPU_API_KEY: str = ""
TONGYI_API_KEY: str = ""
CORS_ORIGINS: str = "http://localhost:3000"
settings = Settings()