Restarting Gunicorn/Nginx when changes are made to files

耗尽温柔 提交于 2019-12-23 12:52:16

问题


I'm working on developing a web app using Django, hosted on Gunicorn and Nginx. It's getting a bit inconvenient to run "sudo service nginx restart; sudo service gunicorn restart" every time I make a change to the code. Is there a way I can make them restart automatically whenever I make a change, or make it so the changes show up without having to restart?


回答1:


You could add the '--reload' argument, as mentioned in the gunicorn documentation.

Restart workers when code changes.

This setting is intended for development. It will cause workers to be restarted whenever application code changes.

Source: http://docs.gunicorn.org/en/latest/settings.html



来源:https://stackoverflow.com/questions/31031855/restarting-gunicorn-nginx-when-changes-are-made-to-files

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!