Replies: 3 comments
-
Hello @saromba , I had this issue a few time porting a Flask app from 2.14.2 to 3.0.6, it tried the "with app.app.app_context()" but for some reason it did not work in my app. What did work was one of the answers here that suggests to add In my case putting it anywhere in the run.py worked, hope it helps. |
Beta Was this translation helpful? Give feedback.
-
I have the same issue and tried it with a custom middleware
Wouldn't it be better to permanently push the app_context before the other handlers have run? This would also allow the use of the |
Beta Was this translation helpful? Give feedback.
-
For what it's worth, Flask version 3.0 added the requirement of a context. The OP's code refers to many things not shown, like how |
Beta Was this translation helpful? Give feedback.
-
Hi all,
how does this work with this app.app_context() thing?
The application (swagger ui) is running properly, but when calling an endpoint, it seems that something is not instantiated properly.
I got an error from my utils.py (when calling the database).
Here is my run.py
Kind regards,
Sascha
Beta Was this translation helpful? Give feedback.
All reactions