-
I know that my issue is to do with the changes related to app context in Flask 2.2.x and Flask-SQLAlchemy 3.x, and I know that I need to push a context in order to get my code to work, but I am unsure of where and exactly how to do so. Any help would be appreciated. All of the tables in my models.py file take advantage of SQLAlchemy's ability to reflect database objects. Flask fails to run because models.py
init.py
The app works as expected with Flask==2.1.3 & Flask-SQLAlchemy==2.5.1, but with Flask==2.2.2 & Flask-SQLAlchemy==3.0.2 I get the error:
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
I spent about a day trying to sort this problem out before I posted this question, but I should have given myself a couple more hours. I am going to answer my own question in case anyone else comes looking. I was able to resolve my "outside of application context" error with the following changes (in bold italic) to my models.py
|
Beta Was this translation helpful? Give feedback.
I spent about a day trying to sort this problem out before I posted this question, but I should have given myself a couple more hours. I am going to answer my own question in case anyone else comes looking.
I was able to resolve my "outside of application context" error with the following changes (in bold italic) to my
models.py
:models.py