From 9199a3ab47af269d34a6f4d8a1747d8797bf70c8 Mon Sep 17 00:00:00 2001 From: zuber Date: Wed, 12 Aug 2009 22:24:20 +0200 Subject: [PATCH 1/1] Dodanie skryptu dispatch.wsgi. --- project/dispatch.wsgi | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100755 project/dispatch.wsgi diff --git a/project/dispatch.wsgi b/project/dispatch.wsgi new file mode 100755 index 00000000..5724b23c --- /dev/null +++ b/project/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() + -- 2.20.1