oxdata/wsgi/django.wsgi
2009-08-20 21:09:35 +02:00

35 lines
882 B
Python

# django.wsgi
import os
import sys
import site
project_module = 'oxdata'
root_dir = os.path.normpath(os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '..')))
site_package = os.path.normpath(os.path.join(root_dir, project_module, '..', 'env', 'lib', 'python2.5', 'site-packages'))
site.addsitedir(site_package)
# add this django project
sys.path.append(root_dir)
sys.path.append(os.path.join(root_dir, project_module))
sys.path.append(site_package)
#remove local folders
sys.path = filter(lambda x: "local" not in x, sys.path)
site.addsitedir(site_package)
#reload if this django.wsgi gets touched
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()