Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Reverted deprecation of media context processor (from r14293) to sepa…

…rate static files and media files a bit more.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@14535 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 70edd4e103832dc95c42643365d1d676c6d5ded6 1 parent 63023e6
@jezdez jezdez authored
View
3  django/conf/global_settings.py
@@ -194,9 +194,10 @@
'django.contrib.auth.context_processors.auth',
'django.core.context_processors.debug',
'django.core.context_processors.i18n',
- 'django.contrib.staticfiles.context_processors.staticfiles',
+ 'django.core.context_processors.media',
# 'django.core.context_processors.request',
'django.contrib.messages.context_processors.messages',
+ 'django.contrib.staticfiles.context_processors.staticfiles',
)
# Output to use in template system for invalid (e.g. misspelled) variables.
View
1  django/contrib/staticfiles/context_processors.py
@@ -3,5 +3,4 @@
def staticfiles(request):
return {
'STATICFILES_URL': settings.STATICFILES_URL,
- 'MEDIA_URL': settings.MEDIA_URL,
}
View
10 django/core/context_processors.py
@@ -71,15 +71,7 @@ def media(request):
Adds media-related context variables to the context.
"""
- import warnings
- warnings.warn(
- "The context processor at `django.core.context_processors.media` is " \
- "deprecated; use the path `django.contrib.staticfiles.context_processors.staticfiles` " \
- "instead.",
- PendingDeprecationWarning
- )
- from django.contrib.staticfiles.context_processors import staticfiles as staticfiles_context_processor
- return staticfiles_context_processor(request)
+ return {'MEDIA_URL': settings.MEDIA_URL}
def request(request):
return {'request': request}
View
1  docs/howto/static-files.txt
@@ -154,6 +154,7 @@ editing that setting by hand it should look something like::
TEMPLATE_CONTEXT_PROCESSORS = (
'django.core.context_processors.debug',
'django.core.context_processors.i18n',
+ 'django.core.context_processors.media',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
'django.contrib.staticfiles.context_processors.staticfiles',
View
6 docs/ref/settings.txt
@@ -1512,12 +1512,6 @@ of items to be merged into the context.
``django.core.context_processors.auth`` to
``django.contrib.auth.context_processors.auth``.
-.. versionchanged:: 1.3
- ``django.core.context_processors.media`` was replaced by
- :func:`django.contrib.staticfiles.context_processors.staticfiles` in the
- default. For more information, see the :doc:`staticfiles documentation
- </ref/contrib/staticfiles>`.
-
.. setting:: TEMPLATE_DEBUG
TEMPLATE_DEBUG
View
11 docs/ref/templates/api.txt
@@ -311,8 +311,9 @@ and return a dictionary of items to be merged into the context. By default,
("django.contrib.auth.context_processors.auth",
"django.core.context_processors.debug",
"django.core.context_processors.i18n",
- "django.contrib.staticfiles.context_processors.staticfiles",
- "django.contrib.messages.context_processors.messages")
+ "django.core.context_processors.media",
+ "django.contrib.messages.context_processors.messages",
+ "django.contrib.staticfiles.context_processors.staticfiles")
.. versionadded:: 1.2
In addition to these, ``RequestContext`` always uses
@@ -434,12 +435,6 @@ If :setting:`TEMPLATE_CONTEXT_PROCESSORS` contains this processor, every
``RequestContext`` will contain a variable ``MEDIA_URL``, providing the
value of the :setting:`MEDIA_URL` setting.
-.. versionchanged:: 1.3
- This context processor has been moved to the new
- :doc:`/ref/contrib/staticfiles` app. Please use the new
- ``django.contrib.staticfiles.context_processors.staticfiles``
- context processor.
-
django.core.context_processors.csrf
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Please sign in to comment.
Something went wrong with that request. Please try again.