From 6603ec551a5c00ee92c09fd8954bdd6447c24b61 Mon Sep 17 00:00:00 2001 From: benoitc Date: Tue, 15 May 2012 10:24:39 +0200 Subject: [PATCH] fix django wsgi example The wsgi file generated by django wasn't adding the project to PYTHONPATH. This change fix it by detecting it based on the wsgi.py path. --- examples/frameworks/django/testing/testing/wsgi.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/examples/frameworks/django/testing/testing/wsgi.py b/examples/frameworks/django/testing/testing/wsgi.py index c9a07fd6..5be3fb9c 100644 --- a/examples/frameworks/django/testing/testing/wsgi.py +++ b/examples/frameworks/django/testing/testing/wsgi.py @@ -14,7 +14,13 @@ framework. """ import os +import sys +# make sure the current project is in PYTHONPATH +sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), + ".."))) + +# set the environment settings os.environ.setdefault("DJANGO_SETTINGS_MODULE", "testing.settings") # This application object is used by any WSGI server configured to use this