diff options
| author | Malcolm Tredinnick <malcolm.tredinnick@gmail.com> | 2006-10-23 07:39:19 +0000 |
|---|---|---|
| committer | Malcolm Tredinnick <malcolm.tredinnick@gmail.com> | 2006-10-23 07:39:19 +0000 |
| commit | 3f4179464f04348167ff1033eaf353fab47297db (patch) | |
| tree | a623d77f87bc2c7ac3275bdf9ccdacd68045fedb /docs/templates_python.txt | |
| parent | 6cd6d9b85f6834c152bf073f96b4bb34377a3a86 (diff) | |
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
Diffstat (limited to 'docs/templates_python.txt')
| -rw-r--r-- | docs/templates_python.txt | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/docs/templates_python.txt b/docs/templates_python.txt index a1d15811f8..81e7d45133 100644 --- a/docs/templates_python.txt +++ b/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 |
