Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Restarting Gunicorn/Nginx when changes are made to files

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?

like image 937
sbl Avatar asked Jun 24 '15 16:06

sbl


1 Answers

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

like image 137
Andrew Zick Avatar answered Sep 27 '22 17:09

Andrew Zick