Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
bowenliang123 committed Nov 27, 2024
1 parent b102ed8 commit 07e29ef
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
10 changes: 4 additions & 6 deletions api/app_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
ext_sentry,
ext_storage,
ext_timezone,
ext_warnings,
ext_warnings, ext_set_secretkey,
)


Expand All @@ -52,21 +52,19 @@ def create_flask_app_with_configs() -> Flask:
return dify_app


def create_app() -> Flask:
def create_app() -> DifyApp:
app = create_flask_app_with_configs()
app.secret_key = dify_config.SECRET_KEY
initialize_extensions(app)
return app


def initialize_extensions(app: Flask):
# Since the application instance is now created, pass it to each Flask
# extension instance to bind it to the Flask application instance (app)
def initialize_extensions(app: DifyApp):
extensions = [
ext_timezone,
ext_logging,
ext_warnings,
ext_import_modules,
ext_set_secretkey,
ext_compress,
ext_code_based_extension,
ext_database,
Expand Down
6 changes: 6 additions & 0 deletions api/extensions/ext_set_secretkey.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from configs import dify_config
from dify_app import DifyApp


def init_app(app: DifyApp):
app.secret_key = dify_config.SECRET_KEY

0 comments on commit 07e29ef

Please sign in to comment.