I don't know what have happened, but after months of developing a Python💕Flask project, I suddenly cannot run it in debug mode. Python gets stuck at displaying:
When running via Visual Studio, it just remains like that, the IDLE Python Shell waits there for a bit and then returns to >>> prompt as the program has escaped without any errors.
The problem isn't in my code, the same happens when simply trying to run an empty Flask app:
from flask import Flask
Flask(__name__).run(debug=True)
If debug is on False, it all runs perfectly, but that makes development significantly more uncomfortable.
I've tried a couple of Python versions, even re-installed, didn't work.
What could be the problem?
Was having the same problem with debug=True. Selecting the legacy debug checkbox in the options seemed to enable reloading after changes without needing to restart. But now it doesn't automatically launch the website when i click on start, you have to manually type in localhost:xxxx in the browser.
Following are the steps that worked for me in Visual Studio 2019:
select options from the tools drop down
select python
select debugging
check the "Use legacy debugger" option(it was unchecked by default)

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With