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