6 PROJECT_ROOT = path.realpath(path.dirname(__file__))
8 # Redirect sys.stdout to sys.stderr for bad libraries like geopy that use
9 # print statements for optional import exceptions.
10 sys.stdout = sys.stderr
12 # Add apps and lib directories to PYTHONPATH
13 sys.path.insert(0, path.join(PROJECT_ROOT, '../apps'))
14 sys.path.insert(0, path.join(PROJECT_ROOT, '../lib'))
16 # Emulate manage.py path hacking.
17 sys.path.insert(0, path.join(PROJECT_ROOT, ".."))
18 sys.path.insert(0, PROJECT_ROOT)
21 os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'
23 from django.core.handlers.wsgi import WSGIHandler
24 application = WSGIHandler()