refactor: Create a dify_config with Pydantic. (#5938)

This commit is contained in:
-LAN-
2024-07-03 21:09:23 +08:00
committed by GitHub
parent c490bdfbf9
commit cb8feb732f
3 changed files with 8 additions and 3 deletions

View File

@@ -1,6 +1,6 @@
import os
from configs.app_config import DifyConfig
from configs import dify_config
if not os.environ.get("DEBUG") or os.environ.get("DEBUG", "false").lower() != 'true':
from gevent import monkey
@@ -81,7 +81,7 @@ def create_flask_app_with_configs() -> Flask:
with configs loaded from .env file
"""
dify_app = DifyApp(__name__)
dify_app.config.from_mapping(DifyConfig().model_dump())
dify_app.config.from_mapping(dify_config.model_dump())
# populate configs into system environment variables
for key, value in dify_app.config.items():