Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion python/cloud-run-python-hello-world/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Flask==2.3.3
Flask==3.1.3
requests==2.31.0
debugpy # Required for debugging.
2 changes: 1 addition & 1 deletion python/python-guestbook/src/backend/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Flask==2.3.3
Flask==3.1.3

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

Upgrading to Flask 3.x will break the backend application due to an incompatibility with Flask-PyMongo==2.3.0.\n\n### Issue Details\nFlask 3.0 completely removed the deprecated _app_ctx_stack and _request_ctx_stack globals. Flask-PyMongo (last released in 2020) imports _app_ctx_stack from flask, which will raise an ImportError and cause the application to crash on startup.\n\n### Recommended Solution\nSince Flask-PyMongo is unmaintained, the best approach is to replace it with the official pymongo driver directly:\n\n1. In python/python-guestbook/src/backend/requirements.txt, replace Flask-PyMongo==2.3.0 with pymongo>=4.0.0.\n2. In python/python-guestbook/src/backend/back.py, update the MongoDB initialization:\npython\nfrom pymongo import MongoClient\n\nclient = MongoClient(os.environ.get('GUESTBOOK_DB_ADDR'))\ndb = client.guestbook\n\nAnd update the route handlers to use db instead of mongo.db.

Flask-PyMongo==2.3.0
bleach==5.0.1
debugpy # Required for debugging
2 changes: 1 addition & 1 deletion python/python-guestbook/src/frontend/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Flask==2.3.3
Flask==3.1.3
requests==2.31.0
python-dateutil==2.8.2
debugpy # Required for debugging
2 changes: 1 addition & 1 deletion python/python-hello-world/src/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
Flask==2.3.3
Flask==3.1.3
debugpy # Required for debugging