Categories
Python Answers

How to debug a Python Flask app running in Gunicorn?

Spread the love

Sometimes, we want to debug a Python Flask app running in Gunicorn.

In this article, we’ll look at how to debug a Python Flask app running in Gunicorn.

How to debug a Python Flask app running in Gunicorn?

To debug a Python Flask app running in Gunicorn, we can set the DEBUG setting to True.

For instance, we write

app = Flask(__name__)
app.config.from_pyfile('config.py')

to read the config from config.py with from_pyfile.

Then we write

DEBUG = True

to set the DEBUG setting to True to enable debugging in our Flask app.

Conclusion

To debug a Python Flask app running in Gunicorn, we can set the DEBUG setting to True.

By John Au-Yeung

Web developer specializing in React, Vue, and front end development.

Leave a Reply

Your email address will not be published. Required fields are marked *