问题
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