New debugger error since upgrading to 2021.2
I have a flask app, that spawns a separate process that also uses sqlalchemy to talk to the database. I created a debug configuration to call a script to start it. It always worked fine in PyCharm. And VsCode. And the command line.
Upgraded to 2021.2, and now I get an error when I start it, the flask_sqlalchemy "'No application found. Either work inside a view function or push".
Go back to 2021.13, and everything is fine. Everything still works fine in VSCode, cmd, etc.
Any idea on what's changed? Sticking with 2021.13 for now.
Please sign in to leave a comment.
Do you get the issue when running as well as when debugging? The only known issue with Flask in 2021.2 I recall is PY-49984
If it's reproduced when running without debugger, is it possible to provide minimal project sample so I could reproduce it locally?
No error when running, just when debugging. Debugging in VSCode and previous versions of PyCharm works just fine though.
This is a pretty massive app that I inherited, I'm not sure I can boil it down to a test project. I'll give it a shot when I have some free time.
The basic structure is this - a flask project with a db, and a subclass of multiprocessing Process that is spawned off and also talks to the db. It is this secondary process that's failing, the first time it attempts to query the database. The actual web app works fine.
The script that launches everything is basically this:
App context should exist, and everything works fine when executing, or running in other debuggers. It's just this new version that creates problems.