From e479bb0f554632dae54bc33dcdae93bf05cf40e0 Mon Sep 17 00:00:00 2001 From: Roberto Rosario Date: Fri, 4 Feb 2011 13:21:28 -0400 Subject: [PATCH] Added wsgi file --- wsgi/dispatch.wsgi | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100755 wsgi/dispatch.wsgi diff --git a/wsgi/dispatch.wsgi b/wsgi/dispatch.wsgi new file mode 100755 index 0000000000..c2abbd5ee1 --- /dev/null +++ b/wsgi/dispatch.wsgi @@ -0,0 +1,22 @@ +import os +import sys +import site + +sys.stdout = sys.stderr + +ve_path = os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "..", "lib/python2.6/site-packages")) +# Add the virtual Python environment site-packages directory to the path +site.addsitedir(ve_path) + +# put the Django project on sys.path +sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))) +sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), "..", ".."))) +sys.path.insert(0, ve_path) + +# Avoid ``[Errno 13] Permission denied: '/var/www/.python-eggs'`` messages +os.environ['PYTHON_EGG_CACHE'] = '/tmp' +os.environ['DJANGO_SETTINGS_MODULE'] = 'settings' + +from django.core.handlers.wsgi import WSGIHandler +application = WSGIHandler() +