简体   繁体   中英

How can I debug my flask app when it wont run?

I've been developing my flask app locally for a while and I've had no problems. I am currently working in a virtual environment. Now when I try to start my flask app, it times out and won't load.

python app.py
 * Serving Flask app "app" (lazy loading)
 * Environment: production
   WARNING: Do not use the development server in a production environment.
   Use a production WSGI server instead.
 * Debug mode: on
WARNING:werkzeug: * Debugger is active!

Nothing else happens after this. If I edit my code in my text editor and save it, the debugger recognizes it by displaying this.

WARNING:werkzeug: * Debugger is active!
WARNING:werkzeug: * Debugger is active!
WARNING:werkzeug: * Debugger is active!
WARNING:werkzeug: * Debugger is active!

I've had this running uninterrupted for 5 minutes and nothing happens. I don't know what to do.

Delete and reinstall your virtual environment. That may "flush" some errors.

Also, is your app running in debug mode? It should be if you're developing locally. The following should be at the bottom of your code.

app.run(debug=True)

Please let me know if that works, otherwise i'll keep searching for you.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM