How can i update flask templates without restarting the uwsgi instance?

Question:

I have a flask application using an uwsgi instance. This application runs some threads in background when a cron command starts. Is there a method for updating my template files without restarting the uwsgi service ?

Currently I’m waiting for my threads to stop and then reloading the uwsgi service.

Answers:

Enabling TEMPLATES_AUTO_RELOAD works nicely:

app = Flask(__name__)
app.config['TEMPLATES_AUTO_RELOAD'] = True

Whether to check for modifications of the template source and reload
it automatically. By default the value is None which means that Flask
checks original file only in debug mode.

Source: http://flask.pocoo.org/docs/0.12/config/

Answered By: Piotr Dawidiuk
Categories: questions Tags: , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.