Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions backend/app/config.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
"""
配置管理
统一从项目根目录的 .env 文件加载配置
"""
"""\n配置管理\n统一从项目根目录的 .env 文件加载配置\n"""

import os
from dotenv import load_dotenv
Expand All @@ -22,9 +19,9 @@ class Config:

# Flask配置
SECRET_KEY = os.environ.get('SECRET_KEY', 'mirofish-secret-key')
DEBUG = os.environ.get('FLASK_DEBUG', 'True').lower() == 'true'
DEBUG = os.environ.get('FLASK_DEBUG', 'False').lower() == 'true'

# JSON配置 - 禁用ASCII转义,让中文直接显示(而不是 \uXXXX 格式)
# JSON配置 - 禁用ASCII转义,让中文直接显示
JSON_AS_ASCII = False

# LLM配置(统一使用OpenAI格式)
Expand Down Expand Up @@ -71,5 +68,7 @@ def validate(cls):
errors.append("LLM_API_KEY 未配置")
if not cls.ZEP_API_KEY:
errors.append("ZEP_API_KEY 未配置")
if cls.DEBUG:
import warnings
warnings.warn("Flask DEBUG mode is enabled. Do not use in production.", RuntimeWarning)
return errors