mirror of
https://github.com/django/django.git
synced 2025-10-25 14:46:09 +00:00
Fixed #2600 -- Added an option to allow serving admin media from a custom path
with dev server. Thanks, adurdin@gmail.com. git-svn-id: http://code.djangoproject.com/svn/django/trunk@3811 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user