Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed #1271 -- Added a 'request' template context processor, which is…

… not activated by default.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@2133 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 1dc65cb6ab158fae3ccae55512a4f49ec3654758 1 parent e356550
Adrian Holovaty authored January 27, 2006
1  django/conf/global_settings.py
@@ -110,6 +110,7 @@
110 110
     'django.core.context_processors.auth',
111 111
     'django.core.context_processors.debug',
112 112
     'django.core.context_processors.i18n',
  113
+#    'django.core.context_processors.request',
113 114
 )
114 115
 
115 116
 # URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a
3  django/core/context_processors.py
@@ -38,6 +38,9 @@ def i18n(request):
38 38
         context_extras['LANGUAGE_CODE'] = LANGUAGE_CODE
39 39
     return context_extras
40 40
 
  41
+def request(request):
  42
+    return {'request': request}
  43
+
41 44
 # PermWrapper and PermLookupDict proxy the permissions system into objects that
42 45
 # the template system can understand.
43 46
 
10  docs/templates_python.txt
@@ -329,6 +329,16 @@ See the `internationalization docs`_ for more.
329 329
 .. _LANGUAGE_CODE setting: http://www.djangoproject.com/documentation/settings/#language-code
330 330
 .. _internationalization docs: http://www.djangoproject.com/documentation/i18n/
331 331
 
  332
+django.core.context_processors.request
  333
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  334
+
  335
+**New in Django development version**
  336
+
  337
+If ``TEMPLATE_CONTEXT_PROCESSORS`` contains this processor, every
  338
+``DjangoContext`` will contain a variable ``request``, which is the current
  339
+`HttpRequest object`_. Note that this processor is not enabled by default;
  340
+you'll have to activate it.
  341
+
332 342
 Loading templates
333 343
 -----------------
334 344
 

0 notes on commit 1dc65cb

Please sign in to comment.
Something went wrong with that request. Please try again.