mirror of
https://github.com/django/django.git
synced 2025-09-27 20:49:21 +00:00
Fixed #10636 -- Added check to make sure the ADMIN_MEDIA_PREFIX setting is properly set before serving files with the AdminMediaHandler.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@14593 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
33d8fcde8a
commit
96af304747
1 changed files with 5 additions and 0 deletions
|
@ -650,6 +650,11 @@ class AdminMediaHandler(handlers.StaticFilesHandler):
|
|||
|
||||
def get_base_url(self):
|
||||
from django.conf import settings
|
||||
from django.core.exceptions import ImproperlyConfigured
|
||||
if not settings.ADMIN_MEDIA_PREFIX:
|
||||
raise ImproperlyConfigured(
|
||||
"The ADMIN_MEDIA_PREFIX setting can't be empty "
|
||||
"when using the AdminMediaHandler, e.g. with runserver.")
|
||||
return settings.ADMIN_MEDIA_PREFIX
|
||||
|
||||
def file_path(self, url):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue