refactor: extract cors configs into dify config and cleanup the config class (#5507)
Co-authored-by: takatost <takatost@gmail.com>
This commit is contained in:
@@ -24,7 +24,6 @@ from flask_cors import CORS
|
||||
from werkzeug.exceptions import Unauthorized
|
||||
|
||||
from commands import register_commands
|
||||
from config import Config
|
||||
|
||||
# DO NOT REMOVE BELOW
|
||||
from events import event_handlers
|
||||
@@ -82,7 +81,6 @@ def create_flask_app_with_configs() -> Flask:
|
||||
with configs loaded from .env file
|
||||
"""
|
||||
dify_app = DifyApp(__name__)
|
||||
dify_app.config.from_object(Config())
|
||||
dify_app.config.from_mapping(DifyConfig().model_dump())
|
||||
return dify_app
|
||||
|
||||
@@ -232,7 +230,7 @@ def register_blueprints(app):
|
||||
app = create_app()
|
||||
celery = app.extensions["celery"]
|
||||
|
||||
if app.config['TESTING']:
|
||||
if app.config.get('TESTING'):
|
||||
print("App is running in TESTING mode")
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user