From fce191c0db3796867fbcb4540eb1cc8358bc33ab Mon Sep 17 00:00:00 2001 From: benoitc Date: Fri, 22 Oct 2010 05:20:21 +0200 Subject: [PATCH] fix issue #106. Thanks for the report. --- gunicorn/app/djangoapp.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gunicorn/app/djangoapp.py b/gunicorn/app/djangoapp.py index cbc73384d..4678cc49b 100644 --- a/gunicorn/app/djangoapp.py +++ b/gunicorn/app/djangoapp.py @@ -7,9 +7,6 @@ import sys import traceback -from django.core.handlers.wsgi import WSGIHandler -from django.core.servers.basehttp import AdminMediaHandler, WSGIServerException - from gunicorn.config import Config from gunicorn.app.base import Application @@ -44,6 +41,7 @@ def no_settings(self, path): sys.exit(1) def load(self): + from django.core.handlers.wsgi import WSGIHandler os.environ['DJANGO_SETTINGS_MODULE'] = self.settings_modname return WSGIHandler() @@ -89,6 +87,8 @@ def load_config(self): self.cfg.set(k.lower(), v) def load(self): + from django.core.servers.basehttp import AdminMediaHandler, WSGIServerException + from django.core.handlers.wsgi import WSGIHandler try: return AdminMediaHandler(WSGIHandler(), self.admin_media_path) except WSGIServerException, e: