How to debug a Flask app
Quick tip - if you use a PyCharm, go to Edit Configurations => Configurations and enable FLASK_DEBUG checkbox, restart the Run.
How are you meant to debug errors in Flask?  Print to the console?  Flash messages to the page?  Or is there a more powerful option available to figure out what's happening when something goes wrong?