summaryrefslogtreecommitdiff
path: root/config/wsgi.py
blob: 3decdc702bf6a5b64b888a1bc9479b5381f2e3fd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import os, sys, site
from os.path import dirname, abspath

# Fix markdown.py (and potentially others) using stdout
sys.stdout = sys.stderr

SERVER_ROOT = abspath(dirname(dirname(__file__)))+'/'
# Tell wsgi to add the Python site-packages to it's path.
site.addsitedir(SERVER_ROOT+'venv/lib/python3.4/site-packages')

os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings.settings")

sys.path = [SERVER_ROOT,] + sys.path
sys.path.insert(0, os.path.join(SERVER_ROOT, "app"))
sys.path.insert(0, os.path.join(SERVER_ROOT, "app/lib"))
sys.path.insert(0, os.path.join(SERVER_ROOT, "config"))

from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()