chiangf / Flask-Elasticsearch

Flask extension that provides simple integration with Elasticsearch
MIT License
134 stars 21 forks source link

ImportError: cannot import name '_request_ctx_stack' from 'flask' #19

Open mikekeda opened 8 months ago

mikekeda commented 8 months ago

In Flask 3.0.0 deprecated _app_ctx_stack and _request_ctx_stack were removed https://flask.palletsprojects.com/en/3.0.x/changes/#version-3-0-0 https://github.com/pallets/flask/pull/5223/

g should be used instead:

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.