flask-sqlalchemy-session
flask-sqlalchemy-session copied to clipboard
`_app_ctx_stack.top` is deprecated and will be removed in Flask 2.3
trafficstars
I'm getting the following warning:
venv/lib/python3.9/site-packages/flask_sqlalchemy_session/__init__.py:11
venv/lib/python3.9/site-packages/flask_sqlalchemy_session/__init__.py:11
venv/lib/python3.9/site-packages/flask_sqlalchemy_session/__init__.py:11:
DeprecationWarning: '_app_ctx_stack' is deprecated and will be removed in Flask 2.3.
from flask import _app_ctx_stack, current_app
These are the relevant notes from Flask's 2.2.0 release notes:
- The app and request contexts are managed using Python context vars directly rather than Werkzeug’s LocalStack. This should result in better performance and memory use. #4682
- Extension maintainers, be aware that _app_ctx_stack.top and _request_ctx_stack.top are deprecated. Store data on g instead using a unique prefix, like g._extension_name_attr.