Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed #2837 -- Documented the context_instance parameter to

render_to_response().


git-svn-id: http://code.djangoproject.com/svn/django/trunk@3911 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 3f4179464f04348167ff1033eaf353fab47297db 1 parent 6cd6d9b
@malcolmt malcolmt authored
Showing with 14 additions and 0 deletions.
  1. +14 −0 docs/templates_python.txt
View
14 docs/templates_python.txt
@@ -311,6 +311,20 @@ optional, third positional argument, ``processors``. In this example, the
'foo': 'bar',
}, [ip_address_processor])
+Note::
+ If you are using Django's ``render_to_response()`` shortcut to populate a
+ template with the contents of a dictionary, your template will be passed a
+ ``Context`` instance by default (not a ``RequestContext``). If you wish to
+ use a ``RequestContext`` in your template rendering, you need to pass an
+ optional third argument to ``render_to_response()``: a ``RequestContext``
+ instance. Your code might look like this::
+
+ def some_view(request):
+ # ...
+ return render_to_response('my_template'html',
+ my_data_dictionary,
+ context_instance = RequestContext(request))
+
Here's what each of the default processors does:
.. _HttpRequest object: http://www.djangoproject.com/documentation/request_response/#httprequest-objects
Please sign in to comment.
Something went wrong with that request. Please try again.