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?
While lightweight and easy to use, Flask's built-in server is not suitable for production as it doesn't scale well. Some of the options available for properly running Flask in production are documented here.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With