Skip to Content
Building Web Applications with Flask
book

Building Web Applications with Flask

by Italo Maia
June 2015
Intermediate to advanced
160 pages
3h 22m
English
Packt Publishing
Content preview from Building Web Applications with Flask

Debugging, DebugToolbar, and happiness

When running your Flask project in debug mode (app.debug = True), whenever Flask detects that your code has changed it will restart your application. If the given change breaks your application, Flask will display an error message in the console that is actually very simple to analyze. You start reading from the bottom up until you find the first line that mentions a file you wrote; that's where the error was generated. Now, read from the top down until you find a line telling you exactly what the error was. If this approach is not sufficient and if you need to read a variable value—for example, to better understand what is going on—you may use pdb, the standard Python debugging library, like this:

# coding:utf-8 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Building RESTful Python Web Services

Building RESTful Python Web Services

Gastón C. Hillar

Publisher Resources

ISBN: 9781784396152Supplemental Content