jeads/datazilla — pull request #21 by carljm (2012-05-19 03:49:42+00:00)
Title: Add WSGI application and sample Apache config.

This pull request includes the changes from the vendor-dependencies and django-config pull requests, so should be merged after those (and once those are merged, its diff will be a lot smaller!)

This pull request adds a WSGI application module compatible with Apache/mod_wsgi, removes sample config files that are no longer relevant, and adds sample configs for both nginx proxying to a WSGI app server and Apache/mod_wsgi. It also fleshes out / updates the Installation / Deployment section of the README to assume the use of WSGI rather than FastCGI.

Tested and verified that the sample configs both work; with nginx proxying (just for testing purposes) to `./manage.py runserver 0:8080` and Apache handling double-duty on both static files and WSGI.

I suppose it would be best if we both convert our dev environments to use Apache/mod_wsgi at this point, so we match what IT will be using. `yum install httpd mod_wsgi` followed by adding the sample config (with `ServerName` changed) to the end of `/etc/httpd/conf/httpd.conf` was enough to make it work for me. In order to reload the Python code, you don't actually have to restart Apache, you can just touch the `datazilla/wsgi.py` file. Alternatively, you can set `MaxRequestsPerChild 1` in the Apache config and it will always reload the code after every request (this is only sensible for development, of course).