Search engine now should be db change change-proof
[wolnelektury.git] / wolnelektury.wsgi.tmpl
1 #!$PYTHON
2 import site
3 site.addsitedir('$PYTHON_SITE')
4
5 import os
6 from os.path import abspath, dirname, join
7 import sys
8
9 # Redirect sys.stdout to sys.stderr for bad libraries like geopy that use
10 # print statements for optional import exceptions.
11 sys.stdout = sys.stderr
12
13 # Add apps and lib directories to PYTHONPATH
14 sys.path = [
15     '$PROJECT_ROOT',
16         '$PROJECT_ROOT/lib',
17     '$PROJECT_ROOT/lib/librarian',
18         '$PROJECT_ROOT/apps',
19 ] + sys.path
20
21 # Run Django
22 os.environ['DJANGO_SETTINGS_MODULE'] = '$PROJECT_NAME.settings'
23
24 from django.core.handlers.wsgi import WSGIHandler
25 application = WSGIHandler()