Considering how easy templating is with Flask, I don't understand who someone would write HTML directly in the controller the way the author did. I agree that Flask is great, though.
render_template('something.html')
and then write the HTML for the template in a separate code section.
render_template('error.html')Anything else is a distraction.
Using render_template would have left us wondering whether there was anything relevant to the task in render_template, or at best interrupting the reader's flow.