From a7600c8b963f318e45f11f96812f0d90e6590c0e Mon Sep 17 00:00:00 2001 From: cuiweizhi <560397@gree.com.cn> Date: Sat, 4 Nov 2023 12:26:34 +0800 Subject: [PATCH] Update project --- app.py | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/app.py b/app.py index 8295ef9..7793bc1 100644 --- a/app.py +++ b/app.py @@ -12,8 +12,22 @@ from application import create_app -app = create_app() + +def runserver(): + """ + This function creates a new instance of the Flask application and runs it. + """ + + # Create a new instance of the Flask application + app = create_app() + + # Run the Flask development server + # The run() method starts the application's development server. + # It's not meant to be used on production environment. + app.run(debug=True) if __name__ == "__main__": - app.run() + # Only run the development server if the script is executed directly. + # This allows other scripts to import this file without starting the server. + runserver() -- GitLab