mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-02-03 13:14:30 +03:00
Remove ADMIN_MEDIA_PREFIX everywhere
This commit is contained in:
parent
9277f438cb
commit
b074754b54
|
@ -348,7 +348,6 @@ class DocumentingTemplateRenderer(BaseRenderer):
|
||||||
'logout_url': logout_url,
|
'logout_url': logout_url,
|
||||||
'FORMAT_PARAM': self._FORMAT_QUERY_PARAM,
|
'FORMAT_PARAM': self._FORMAT_QUERY_PARAM,
|
||||||
'METHOD_PARAM': getattr(self.view, '_METHOD_PARAM', None),
|
'METHOD_PARAM': getattr(self.view, '_METHOD_PARAM', None),
|
||||||
'ADMIN_MEDIA_PREFIX': getattr(settings, 'ADMIN_MEDIA_PREFIX', None),
|
|
||||||
})
|
})
|
||||||
|
|
||||||
ret = template.render(context)
|
ret = template.render(context)
|
||||||
|
|
|
@ -53,11 +53,6 @@ MEDIA_ROOT = ''
|
||||||
# Examples: "http://media.lawrence.com", "http://example.com/media/"
|
# Examples: "http://media.lawrence.com", "http://example.com/media/"
|
||||||
MEDIA_URL = ''
|
MEDIA_URL = ''
|
||||||
|
|
||||||
# URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a
|
|
||||||
# trailing slash.
|
|
||||||
# Examples: "http://foo.com/media/", "/media/".
|
|
||||||
ADMIN_MEDIA_PREFIX = '/media/'
|
|
||||||
|
|
||||||
# Make this unique, and don't share it with anybody.
|
# Make this unique, and don't share it with anybody.
|
||||||
SECRET_KEY = 'u@x-aj9(hoh#rb-^ymf#g2jx_hp0vj7u5#b@ag1n^seu9e!%cy'
|
SECRET_KEY = 'u@x-aj9(hoh#rb-^ymf#g2jx_hp0vj7u5#b@ag1n^seu9e!%cy'
|
||||||
|
|
||||||
|
|
|
@ -9,11 +9,6 @@ from djangorestframework.compat import StringIO
|
||||||
import re
|
import re
|
||||||
import xml.etree.ElementTree as ET
|
import xml.etree.ElementTree as ET
|
||||||
|
|
||||||
|
|
||||||
#def admin_media_prefix(request):
|
|
||||||
# """Adds the ADMIN_MEDIA_PREFIX to the request context."""
|
|
||||||
# return {'ADMIN_MEDIA_PREFIX': settings.ADMIN_MEDIA_PREFIX}
|
|
||||||
|
|
||||||
from mediatypes import media_type_matches, is_form_media_type
|
from mediatypes import media_type_matches, is_form_media_type
|
||||||
from mediatypes import add_media_type_param, get_media_type_params, order_by_precedence
|
from mediatypes import add_media_type_param, get_media_type_params, order_by_precedence
|
||||||
|
|
||||||
|
@ -49,38 +44,6 @@ def url_resolves(url):
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
||||||
# From http://www.koders.com/python/fidB6E125C586A6F49EAC38992CF3AFDAAE35651975.aspx?s=mdef:xml
|
|
||||||
#class object_dict(dict):
|
|
||||||
# """object view of dict, you can
|
|
||||||
# >>> a = object_dict()
|
|
||||||
# >>> a.fish = 'fish'
|
|
||||||
# >>> a['fish']
|
|
||||||
# 'fish'
|
|
||||||
# >>> a['water'] = 'water'
|
|
||||||
# >>> a.water
|
|
||||||
# 'water'
|
|
||||||
# >>> a.test = {'value': 1}
|
|
||||||
# >>> a.test2 = object_dict({'name': 'test2', 'value': 2})
|
|
||||||
# >>> a.test, a.test2.name, a.test2.value
|
|
||||||
# (1, 'test2', 2)
|
|
||||||
# """
|
|
||||||
# def __init__(self, initd=None):
|
|
||||||
# if initd is None:
|
|
||||||
# initd = {}
|
|
||||||
# dict.__init__(self, initd)
|
|
||||||
#
|
|
||||||
# def __getattr__(self, item):
|
|
||||||
# d = self.__getitem__(item)
|
|
||||||
# # if value is the only key in object, you can omit it
|
|
||||||
# if isinstance(d, dict) and 'value' in d and len(d) == 1:
|
|
||||||
# return d['value']
|
|
||||||
# else:
|
|
||||||
# return d
|
|
||||||
#
|
|
||||||
# def __setattr__(self, item, value):
|
|
||||||
# self.__setitem__(item, value)
|
|
||||||
|
|
||||||
|
|
||||||
# From xml2dict
|
# From xml2dict
|
||||||
class XML2Dict(object):
|
class XML2Dict(object):
|
||||||
|
|
||||||
|
|
|
@ -53,7 +53,6 @@ def api_login(request, template_name='djangorestframework/login.html',
|
||||||
redirect_field_name: redirect_to,
|
redirect_field_name: redirect_to,
|
||||||
#'site': current_site,
|
#'site': current_site,
|
||||||
#'site_name': current_site.name,
|
#'site_name': current_site.name,
|
||||||
'ADMIN_MEDIA_PREFIX': settings.ADMIN_MEDIA_PREFIX,
|
|
||||||
}, context_instance=RequestContext(request))
|
}, context_instance=RequestContext(request))
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user