diff --git a/app.py b/app.py index 8295ef967a8ba0befd5eedaa2ce91b8ee34f925e..7793bc1cc5e16250f184279aa8bba0904866a6b5 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()