X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/e66808bc9a56116a8b13dc7445c3b5a4fa76148e..e04a3d9448c218e380a0c281f2e6330df3166ead:/wolnelektury.wsgi.template diff --git a/wolnelektury.wsgi.template b/wolnelektury.wsgi.template new file mode 100644 index 000000000..76e390320 --- /dev/null +++ b/wolnelektury.wsgi.template @@ -0,0 +1,25 @@ +#!%(python)s +import site +site.addsitedir('%(path)s/lib/python2.5/site-packages') + +import os +from os.path import abspath, dirname, join +import sys + +# Redirect sys.stdout to sys.stderr for bad libraries like geopy that use +# print statements for optional import exceptions. +sys.stdout = sys.stderr + +# Add apps and lib directories to PYTHONPATH +sys.path = [ + '%(path)s/releases/current/%(project_name)s', + '%(path)s/releases/current', + '%(path)s/releases/current/apps', + '%(path)s/releases/current/lib', +] + sys.path + +# Run Django +os.environ['DJANGO_SETTINGS_MODULE'] = 'settings' + +from django.core.handlers.wsgi import WSGIHandler +application = WSGIHandler()