cyberdelia / flask-mysql

Flask extension for python-mysql
https://flask-mysql.readthedocs.org
MIT License
117 stars 47 forks source link

Project doesn't work with Flask 3.0.0 #55

Open Ret2Me opened 1 year ago

Ret2Me commented 1 year ago

Hi, in new Flask 3.0.0 authors decided to remove deprecated method _request_ctx_stack. Unfortunately your flask-mysql use them what cause exception during booting.

xerosine commented 1 year ago

Yes, now both the initial try and the exception in lines 5 and 7 flag ImportError

antgarhe commented 10 months ago

Do you know any solution or alternative?

xerosine commented 10 months ago

Do you know any solution or alternative?

I had to downgrade to the previous version of flask, 2.3.3 or so

AntGarH commented 10 months ago

Yes, that's a solution, but you lose the benefits of the latest versions, if they have any...

xerosine commented 10 months ago

Yes, that's a solution, but you lose the benefits of the latest versions, if they have any...

True, but till the code is updated, that's pretty much the only way that I know of without using a different package

NiTRoeSE commented 9 months ago

I have exactly the same problem: Flask 3+ and flask-mysqldb throw error: ImportError: cannot import name '_app_ctx_stack' from 'flask' (/usr/local/lib/python3.10/dist-packages/flask/__init__.py)

Hope someone can help or fix flask-mysqldb to be compatible with flask3+.

Thanks in advanced!

BOTcommander7 commented 5 months ago

Same here

AlanBell commented 5 months ago

looks like this is the new syntax to do the same thing https://stackoverflow.com/questions/73349956/deprecationwarning-reque-st-ctx-stack-is-deprecated-and-will-be-removed-in-f

uwe999 commented 3 months ago

maybe switching to https://pypi.org/project/Flask-MySQLdb/2.0.0/ is an option?

LincolnKermit commented 3 weeks ago

Do you know any solution or alternative?

I had to downgrade to the previous version of flask, 2.3.3 or so

Thanks, worked for me!