Use the right PIP in deployment.
[wolnelektury.git] / wolnelektury / wolnelektury.fcgi
1 #!/usr/bin/env python
2 import os
3 from os.path import abspath, dirname, join
4 import sys
5
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
9
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')))
13
14 # Emulate manage.py path hacking.
15 sys.path.insert(0, abspath(join(dirname(__file__), "../")))
16 sys.path.insert(0, abspath(join(dirname(__file__), ".")))
17
18 # Run Django
19 os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'
20
21 from django.core.servers.fastcgi import runfastcgi
22 runfastcgi(method='threaded', daemonize='false')
23