Reflecting changes in your python web-app without restarting apache

This would be a pretty simple hack, and concern the devs using python web frameworks – hosted with apache-wsgi. The Django help to deploy a web-app on the apache server can be found over here[1].
In either way, you will have your apache configuration pointing to the path of the wsgi file of your web-app. You will have something similar to the following in your apache conf.

WSGIScriptAlias /mysite  /path/to/your/application.wsgi

Now – problem come when you have made some local changes to your repo, and do not have sudo privilege to restart your webserver to make the changes take effect. You can fix the same with this simple hack.

$ touch /path/to/your/application.wsgi

touch command[2] in GNU/Linux can do wonders! It can create a new file ( if not exist ), and can refresh the timestamp if one exists.

[1] https://docs.djangoproject.com/en/1.7/howto/deployment/wsgi/modwsgi/
[2] https://en.wikipedia.org/wiki/Touch_(Unix)

Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s