Velvet Star Monitor

Standout celebrity highlights with iconic style.

updates

Is there a way to make Flask more verbose?

Writer Sebastian Wright

I've been using Flask for a little while and find I prefer it to Rails in some ways, particularly for being lightweight. However, one area in which Rails is far superior in my opinion is error reporting. There are many times in Flask where I get an error in my browser, but my console shows no error at all (for example, trying to pull non-existant querystring parameters out of request.form produces a 400 Bad Request, but all you see on the console is the incoming request).

Is there any kind of a verbose mode on Flask which will give me detailed information on all of its behavior?

3 Answers

The debug mode can be enabled via env variable (export FLASK_DEBUG=1) or within the code to allow printing traceback in case of errors as noted below:

app = Flask(__name__)
app.debug = True

You probably want to enable debug mode.

4

Error handling is off by default in production mode at the moment and can be set up here:

1

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy