First draft of example WSGI stuff.

This commit is contained in:
Greg Taylor 2009-01-30 04:16:17 +00:00
parent f69252a490
commit 4cfe2b6bd9
3 changed files with 62 additions and 0 deletions

17
game/web/apache_wsgi.conf Normal file
View file

@ -0,0 +1,17 @@
import os, sys
# Calculate the path based on the location of the WSGI script.
apache_configuration= os.path.dirname(__file__)
web_dir = os.path.dirname(apache_configuration)
workspace = os.path.dirname(os.path.dirname(web_dir))
sys.path.insert(0, workspace)
os.environ['DJANGO_SETTINGS_MODULE'] = 'game.settings'
import django.core.handlers.wsgi
_application = django.core.handlers.wsgi.WSGIHandler()
# This handles apps mounted in places other than the root mount point
def application(environ, start_response):
environ['PATH_INFO'] = environ['SCRIPT_NAME'] + environ['PATH_INFO']
return _application(environ, start_response)