Explore Flask

3.3. Debugging

3.3.1. Debug Mode

Flask comes with a handy feature called debug mode. To turn it on, you just have to set debug = True in your development configuration. When it's on, the server will reload on code changes and errors will come with a stack trace and an interactive console.

Caution Take care not to enable debug mode in production. The interactive console enables arbitrary code execution and would be a massive security vulnerability if it was left on in the live site.

3.3.2. Flask-DebugToolbar

Flask-DebugToolbar is another great tool for debugging problems with your application. In debug mode, it overlays a side-bar onto every page in your application. The side bar gives you information about SQL queries, logging, versions, templates, configuration and other fun stuff that makes it easier to track down problems.