Don't close empty object
[wolnelektury.git] / wolnelektury.wsgi.template
1 #!%(python)s
2 import site
3 site.addsitedir('%(path)s/ve/lib/python2.6/site-packages')
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         '%(path)s/releases/current/%(project_name)s',
16         '%(path)s/releases/current',
17         '%(path)s/releases/current/apps',
18         '%(path)s/releases/current/lib',
19     '%(path)s/releases/current/lib/librarian',
20 ] + sys.path
21
22 # Run Django
23 os.environ["CELERY_LOADER"] = "django"
24 os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'
25
26 from django.core.handlers.wsgi import WSGIHandler
27 application = WSGIHandler()