X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/7f3f79476a57d10991566c511d40e20154c01064..78644811ca0c6042212788dc67add42bc41fb74c:/platforma/dispatch.wsgi diff --git a/platforma/dispatch.wsgi b/platforma/dispatch.wsgi new file mode 100755 index 00000000..5724b23c --- /dev/null +++ b/platforma/dispatch.wsgi @@ -0,0 +1,25 @@ +#!/usr/bin/env python +import os +from os import path +import sys + +PROJECT_ROOT = path.realpath(path.dirname(__file__)) + +# 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.insert(0, path.join(PROJECT_ROOT, '../apps')) +sys.path.insert(0, path.join(PROJECT_ROOT, '../lib')) + +# Emulate manage.py path hacking. +sys.path.insert(0, path.join(PROJECT_ROOT, "..")) +sys.path.insert(0, PROJECT_ROOT) + +# Run Django +os.environ['DJANGO_SETTINGS_MODULE'] = 'settings' + +from django.core.handlers.wsgi import WSGIHandler +application = WSGIHandler() +