Permalink
Browse files

no mre AdminMediaHandler class in django 1.4 . close #333

  • Loading branch information...
1 parent 50828b9 commit 6cffb5b4734090a052b1080ffe99e71b919b7e36 @benoitc benoitc committed Apr 17, 2012
Showing with 5 additions and 1 deletion.
  1. +5 −1 gunicorn/app/django_wsgi.py
@@ -17,12 +17,13 @@
from django.conf import settings
from django.core.management.validation import get_validation_errors
from django.utils import translation
-from django.core.servers.basehttp import AdminMediaHandler
+
try:
from django.core.servers.basehttp import get_internal_wsgi_application
django14 = True
except ImportError:
from django.core.handlers.wsgi import WSGIHandler
+ from django.core.servers.basehttp import AdminMediaHandler
django14 = False
from gunicorn import util
@@ -108,4 +109,7 @@ def reload_django_settings():
def make_command_wsgi_application(admin_mediapath):
reload_django_settings()
+ if django14:
+ return make_wsgi_application()
+
return AdminMediaHandler(make_wsgi_application(), admin_mediapath)

0 comments on commit 6cffb5b

Please sign in to comment.