Fixed #24124 -- Changed context_processors in the default settings.py

This commit is contained in:
Collin Anderson 2015-01-12 10:48:49 -05:00
parent bbbed99f62
commit 26a92619f6
6 changed files with 39 additions and 53 deletions

View file

@ -1873,10 +1873,9 @@ for :doc:`managing stored files </topics/files>`. It must end in a slash if set
to a non-empty value. You will need to :ref:`configure these files to be served
<serving-uploaded-files-in-development>` in both development and production.
In order to use ``{{ MEDIA_URL }}`` in your templates, you must have
If you want to use ``{{ MEDIA_URL }}`` in your templates, add
``'django.template.context_processors.media'`` in the ``'context_processors'``
option of :setting:`TEMPLATES`. It's there by default, but be sure to include
it if you override that setting and want this behavior.
option of :setting:`TEMPLATES`.
Example: ``"http://media.example.com/"``

View file

@ -554,12 +554,9 @@ settings file, the default template engine contains the following context
processors::
[
'django.contrib.auth.context_processors.auth',
'django.template.context_processors.debug',
'django.template.context_processors.i18n',
'django.template.context_processors.media',
'django.template.context_processors.static',
'django.template.context_processors.tz',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
]
@ -625,7 +622,7 @@ Built-in template context processors
Context processors
------------------
Here's what each of the default processors does:
Here's what each of the built-in processors does:
django.contrib.auth.context_processors.auth
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@ -695,8 +692,7 @@ django.template.context_processors.request
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
If this processor is enabled, every ``RequestContext`` will contain a variable
``request``, which is the current :class:`~django.http.HttpRequest`. Note that
this processor is not enabled by default; you'll have to activate it.
``request``, which is the current :class:`~django.http.HttpRequest`.
django.contrib.messages.context_processors.messages
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~