From f68c43780c6300a025b540618994a1102228535f Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Fri, 9 Oct 2009 16:09:11 +0200 Subject: [PATCH] more deployment stuff --- wsgi/django.wsgi | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 wsgi/django.wsgi diff --git a/wsgi/django.wsgi b/wsgi/django.wsgi new file mode 100644 index 00000000..43e5837c --- /dev/null +++ b/wsgi/django.wsgi @@ -0,0 +1,28 @@ +# django.wsgi +import os +import sys +import site + +project_module = 'oxdb' + +root_dir = os.path.normpath(os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))) + +#using virtualenv's activate_this.py to reorder sys.path +activate_this = os.path.join(root_dir, 'bin', 'activate_this.py') +execfile(activate_this, dict(__file__=activate_this)) + +sys.path.append(root_dir) +sys.path.append(os.path.join(root_dir, project_module)) + +#reload if this django.wsgi gets touched +from utils import monitor +monitor.start(interval=1.0) + +monitor.track(os.path.abspath(os.path.dirname(__file__))) + +os.environ['DJANGO_SETTINGS_MODULE'] = project_module + '.settings' + +import django.core.handlers.wsgi + +application = django.core.handlers.wsgi.WSGIHandler() +