Files
000-platform/backend/app/config.py
111 daa8125c58
All checks were successful
continuous-integration/drone/push Build is passing
Initial commit: 000-platform project skeleton
2026-01-23 14:32:09 +08:00

40 lines
1002 B
Python
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
"""配置管理"""
import os
from functools import lru_cache
from pydantic_settings import BaseSettings
class Settings(BaseSettings):
"""应用配置"""
# 应用信息
APP_NAME: str = "000-platform"
APP_VERSION: str = "0.1.0"
DEBUG: bool = False
# 数据库
DATABASE_URL: str = "mysql+pymysql://scrm_reader:ScrmReader2024Pass@47.107.71.55:3306/new_qiqi"
# API Key内部服务调用
API_KEY: str = "platform_api_key_2026"
# 管理员账号
ADMIN_USERNAME: str = "admin"
ADMIN_PASSWORD_HASH: str = "" # bcrypt hash
# JWT
JWT_SECRET: str = "platform_jwt_secret_2026_change_in_prod"
JWT_ALGORITHM: str = "HS256"
JWT_EXPIRE_HOURS: int = 24
# 配置加密密钥
CONFIG_ENCRYPT_KEY: str = "platform_config_key_32bytes!!"
class Config:
env_file = ".env"
extra = "ignore"
@lru_cache()
def get_settings() -> Settings:
return Settings()