[英]How can i update flask templates without restarting the uwsgi instance?
I have a flask application using an uwsgi instance. 我有一个使用uwsgi实例的flask应用程序。 This application runs some threads in background when a cron command starts. 当cron命令启动时,此应用程序在后台运行一些线程。 Is there a method for updating my template files without restarting the uwsgi service ? 是否有一种无需重启uwsgi服务即可更新模板文件的方法?
Currently I'm waiting for my threads to stop and then reloading the uwsgi service. 目前,我正在等待线程停止,然后重新加载uwsgi服务。
Enabling TEMPLATES_AUTO_RELOAD
works nicely: 启用TEMPLATES_AUTO_RELOAD
效果很好:
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. 默认情况下,该值为“无”,这意味着Flask仅在调试模式下检查原始文件。
Source: http://flask.pocoo.org/docs/0.12/config/ 资料来源: http : //flask.pocoo.org/docs/0.12/config/
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.