summaryrefslogtreecommitdiff
path: root/django/core/servers/basehttp.py
diff options
context:
space:
mode:
Diffstat (limited to 'django/core/servers/basehttp.py')
-rw-r--r--django/core/servers/basehttp.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/django/core/servers/basehttp.py b/django/core/servers/basehttp.py
index 4bd0e50e53..a16b8b675a 100644
--- a/django/core/servers/basehttp.py
+++ b/django/core/servers/basehttp.py
@@ -594,11 +594,14 @@ class AdminMediaHandler(object):
Use this ONLY LOCALLY, for development! This hasn't been tested for
security and is not super efficient.
"""
- def __init__(self, application):
+ def __init__(self, application, media_dir=None):
from django.conf import settings
- import django
self.application = application
- self.media_dir = django.__path__[0] + '/contrib/admin/media'
+ if not media_dir:
+ import django
+ self.media_dir = django.__path__[0] + '/contrib/admin/media'
+ else:
+ self.media_dir = media_dir
self.media_url = settings.ADMIN_MEDIA_PREFIX
def __call__(self, environ, start_response):