Answer the question
In order to leave comments, you need to log in
How to apply changes on django-server(ubuntu, nginx, uwsgi) without reboot?
Hello.
Faced such problem: for application of changes in the project it is necessary to reboot OS.
Server with ubuntu 12.04, nginx, uwsgi, python2.7, Django1.6
The following set of commands does not help:
sudo uwsgi --stop /path/to/uwsgi.ini
sudo service nginx restart
sudo uwsgi --ini /path/to/uwsgi.ini
Answer the question
In order to leave comments, you need to log in
For uwsgi - touch-reload, as already said.
After seeing the terrible sudo service nginx restart
:
nginx beginners guide
In the uwsgi.ini settings, you need to add the parameter touch-reload
. It points to the name of the file, when it changes, the application auto-restarts. You can write a bash script that simply adds something like restart [current date and time] to this file and you get something like a django restart log.
In practice (at least for me), everything will auto-restart even if changes occur in any python-file of the project. I don't know why. The uwsgi.ini of the project contains:
touch-reload = /home/[user]/[адрес сайта]/logs/[адрес_сайта]_reload.log
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question