3 from os.path import abspath, dirname, join
6 # Redirect sys.stdout to sys.stderr for bad libraries like geopy that use
7 # print statements for optional import exceptions.
8 sys.stdout = sys.stderr
10 # Add apps and lib directories to PYTHONPATH
11 sys.path.insert(0, abspath(join(dirname(__file__), '../apps')))
12 sys.path.insert(0, abspath(join(dirname(__file__), '../lib')))
14 # Emulate manage.py path hacking.
15 sys.path.insert(0, abspath(join(dirname(__file__), "../")))
16 sys.path.insert(0, abspath(join(dirname(__file__), ".")))
19 os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'
21 from django.core.servers.fastcgi import runfastcgi
22 runfastcgi(method='threaded', daemonize='false')