diff --git a/app.py b/app.py index b3f1103..e989526 100644 --- a/app.py +++ b/app.py @@ -66,10 +66,7 @@ def is_valid_email(email): pattern = r'^[\w\.-]+@[\w\.-]+\.\w+$' return re.match(pattern, email) -# TODO: @before_first_request is deprecated in Flask 2.2 and removed in Flask 3.0. -# Replace with: with app.app_context(): init_db() at module level, or use a CLI command. -@app.before_first_request -def initialize_database(): +with app.app_context(): init_db() @app.route('/', methods=['GET', 'POST']) diff --git a/requirements.txt b/requirements.txt index 4f020a3..faa652e 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,3 @@ -Flask==2.2.5 +Flask>=3.1.3 Werkzeug>=3.0.6 gunicorn \ No newline at end of file