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.

Leave a Reply

Your email address will not be published.

If you like the content of this blog, subscribe to my email list to get exclusive articles not available to anyone else.