Enabling debug mode in Flask

- Andrés Cruz

En español
Enabling debug mode in Flask

The debugging mode or debug is an essential tool in the development of web applications since with it we can effectively develop the application, in addition to identifying and solving errors in the code quickly and efficiently. When the debugging mode is activated, errors with exact details will start to appear by the browser and Flask console and with this, understand exactly what is happening and correct the problem; In this post we will see how to activate the debug mode in Flask.

With our application created in Flask, the next thing that will interest you is to enable its debugging; and this is useful because without it, every time you make changes to the source code, you'll have to bring down the server and bring it up beforehand; which is a great hassle; so, to avoid this, we have the debug option, with True:

if __name__ =='__main__':  
    app.run(debug = True)  

With this, the server will reload automatically.

You can also do this from the configuration file that you have, which is recommended, to have your application well organized.

Andrés Cruz

Develop with Laravel, Django, Flask, CodeIgniter, HTML5, CSS3, MySQL, JavaScript, Vue, Android, iOS, Flutter

Andrés Cruz In Udemy

I agree to receive announcements of interest about this Blog.