@
@
@nixbox2019-11-14 09:29:01
Flask
@nixbox, 2019-11-14 09:29:01

How to enable Flask debug mode on production server with gunicorn?

Hello!
How can I activate Debug mode on a gunicorn server?
To automatically update flask after changing files.
Tips from the Internet that did not help:

app.config['ENV'] = 'development'
app.config['DEBUG'] = True
app.config['TESTING'] = True

from flask_debug import Debug
Debug(app)
app.run(debug=True)

Announcements in the environment
export FLASK_ENV=development 
export FLASK_DEBUG=1
export TEMPLATES_AUTO_RELOAD=True

Also didn't work.
To see the changes, you need to restart the service with the command:
sudo systemctl restart my_flask_app

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
nixbox, 2019-11-14
_

Answer found.
You need to run gunicorn itself with the --reload option

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question