Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to reload new update in Django project with Apache, mod_wsgi?

I am making a project using the Django framework. I have hosted a test server with Apache+mod_wsgi. When I change some lines of code, I upload the file and test it in a browser. But the new changes are not shown unless I reload/restart (/etc/init.d/apache2 reload).

Is there any other way to reload/refresh new changes besides reloading Apache?

like image 496
Elisa Avatar asked Jun 12 '13 06:06

Elisa


1 Answers

Yes, touch your wsgi configuration file.

For me, my server restart script is as simple as touch /srv/grove_project/conf/apache/django.wsgi. Build it into your server management scripts and it's a nice graceful restart.

For more info and when this applies: https://code.google.com/p/modwsgi/wiki/ReloadingSourceCode

From The Man himself: this only works with mod_wsgi in daemon mode.

like image 149
Yuji 'Tomita' Tomita Avatar answered Nov 09 '22 05:11

Yuji 'Tomita' Tomita