Fundamental_Analysis/backend/app/core/config.py
2025-10-28 23:31:28 +08:00

32 lines
965 B
Python

"""
Application settings management using Pydantic
"""
from typing import List, Optional
from pydantic_settings import BaseSettings
class Settings(BaseSettings):
"""Application settings loaded from environment variables."""
APP_NAME: str = "Fundamental Analysis System"
APP_VERSION: str = "1.0.0"
DEBUG: bool = False
# Default database URL switched to SQLite (async) to avoid optional driver issues.
# You can override via config or env to PostgreSQL later.
DATABASE_URL: str = "sqlite+aiosqlite:///./app.db"
DATABASE_ECHO: bool = False
# API settings
API_V1_STR: str = "/api"
ALLOWED_ORIGINS: List[str] = ["http://localhost:3000", "http://127.0.0.1:3000"]
# External service credentials, can be overridden
GEMINI_API_KEY: Optional[str] = None
TUSHARE_TOKEN: Optional[str] = None
class Config:
env_file = ".env"
case_sensitive = True
# Global settings instance
settings = Settings()