From bfd6c985c44995d845c5f4e75e58c9f26115a205 Mon Sep 17 00:00:00 2001 From: cuiweizhi <560397@gree.com.cn> Date: Sat, 4 Nov 2023 12:22:53 +0800 Subject: [PATCH] Update project --- application/__init__.py | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/application/__init__.py b/application/__init__.py index ea183bf..4b51ca5 100644 --- a/application/__init__.py +++ b/application/__init__.py @@ -20,15 +20,29 @@ from application.script import init_script def create_app() -> Flask: - app = Flask(os.path.abspath(os.path.join(os.path.dirname(__file__), "."))) + """ + This function creates and initializes a new Flask application. - # 注册各种插件 + :return: A new instance of a Flask application. + """ + + # Determine the path of the application root directory + app_root_path = os.path.abspath(os.path.join(os.path.dirname(__file__), ".")) + + # Create a new Flask application instance + app = Flask(app_root_path) + + # Initialize various plugins for the application. + # This could include things like database connectors, authentication systems, etc. init_plugs(app) - # 注册路由 + # Register the routes that this application will respond to. + # This includes both the route URLs and the handlers for each route. init_views(app) - # 注册命令 + # Register any scripts or commands that can be run from the command line. + # This could include data migration scripts, administrative tasks, etc. init_script(app) + # Return the fully initialized Flask application return app -- GitLab