18 lines
345 B
Python
18 lines
345 B
Python
from pydantic_settings import BaseSettings
|
|
|
|
|
|
class Settings(BaseSettings):
|
|
ENVIRONMENT: str
|
|
LOG_LEVEL: str
|
|
DB_HOST: str
|
|
DB_PASSWORD: str
|
|
ES_HOST: str
|
|
|
|
class Config:
|
|
env_file = ".env" # 指定.env文件路径
|
|
case_sensitive = False # 忽略变量名大小写
|
|
|
|
|
|
# 全局配置实例
|
|
settings = Settings()
|