how to turn on flask debug mode 2021 code example Example: how to set debug mode on in flask set "FLASK_DEBUG=1" in .flaskenv file of your project.