Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Flask debug mode stuck at "Restarting with stat"

Tags:

python

flask

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:

  • Restarting with stat

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?

like image 769
VÁP Avatar asked Oct 22 '25 12:10

VÁP


1 Answers

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:

  1. select options from the tools drop down

  2. select python

  3. select debugging

  4. check the "Use legacy debugger" option(it was unchecked by default)

screentshot of the option

like image 137
name-andy Avatar answered Oct 25 '25 00:10

name-andy