Set debug=True flag for Flask server#156
Conversation
|
Can you explain what practical difference this makes for the purposes of this tutorial? |
|
Apologies, meant to include a description last night. From the Flask docs, setting
The automatic reloader is not so important for the purposes of the tutorial, but if users modify the Flask server in anyway and introduce a syntax error for example, debug mode dumps out exceptions to the console instead of swallowing them. I was working along with the tutorial last night and simply did a copypasta of Meanwhile, if debug mode is enabled, I get a handy Traceback dumped to stdout: Although my specific example is a bit contrived as I doubt many other users copy and paste |
|
Thanks. I knew generally of its behavior but wasn't sure why you'd hit an exception when working through the tutorial. Your explanation makes sense. |
From the Flask docs, setting
debug=True:The automatic reloader is not so important for the purposes of the tutorial, but if users modify the Flask server in anyway and introduce a syntax error for example, debug mode dumps out exceptions to the console instead of swallowing them.
I was working along with the tutorial last night and simply did a copypasta of
server.pyinstead of cloning the repo which resulted in me missingcomments.py. When querying the comments endpoint, I got a 500 error, but no useful output in the console:Meanwhile, if debug mode is enabled, I get a handy Traceback dumped to stdout:
Although my specific example is a bit contrived as I doubt many other users copy and paste
server.py, debug mode is still handy for local development settings.