diff options
| author | Tim Graham <timograham@gmail.com> | 2015-12-22 10:56:51 -0500 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2015-12-22 13:06:22 -0500 |
| commit | 36d0aa43036090685cebe6c9f757631cdadb1400 (patch) | |
| tree | 76955a1d3029f8c0721d668b77e6663cfbf5badf /docs | |
| parent | 923a4fb20abf449aa677995f108a15999b9d7d2a (diff) | |
[1.9.x] Fixed #25963 -- Clarified render_to_response() context_instance deprecation.
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/releases/1.8.txt | 13 | ||||
| -rw-r--r-- | docs/topics/http/shortcuts.txt | 3 |
2 files changed, 15 insertions, 1 deletions
diff --git a/docs/releases/1.8.txt b/docs/releases/1.8.txt index 906bae408a..42ce0d4edf 100644 --- a/docs/releases/1.8.txt +++ b/docs/releases/1.8.txt @@ -1571,6 +1571,19 @@ pass a :class:`dict` in the ``context`` parameter instead. If you're passing a :class:`~django.template.RequestContext`, pass the request separately in the ``request`` parameter. +If you're using ``context_instance=RequestContext(request))`` with +``render_to_response()``, use :func:`django.shortcuts.render`, which always +makes ``RequestContext`` available, instead. For example:: + + from django.shortcuts import render_to_response + from django.template import RequestContext + render_to_response('template.html', {...}, context_instance=RequestContext(request)) + +becomes:: + + from django.shortcuts import render + render(request, 'template.html', {...}) + ``dirs`` argument of template-finding functions ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/docs/topics/http/shortcuts.txt b/docs/topics/http/shortcuts.txt index 58bffcf64a..db2071684e 100644 --- a/docs/topics/http/shortcuts.txt +++ b/docs/topics/http/shortcuts.txt @@ -158,7 +158,8 @@ Optional arguments .. deprecated:: 1.8 - The ``context_instance`` argument is deprecated. Simply use ``context``. + The ``context_instance`` argument is deprecated. Use the :func:`render` + function instead which always makes ``RequestContext`` available. ``content_type`` The MIME type to use for the resulting document. Defaults to the value of |
