The purpose of render_to_response is "render without a request context" now
as far as I can tell. There are reasons why you would do this, whether they
justify the existence of the shortcut is another question.

On 7 April 2015 at 11:37, Stephen Brooks <[email protected]> wrote:

> In that case the render_to_response shortcut has little value and should
> probably be removed in Django 2.0 ??
>
> On Tuesday, 7 April 2015 11:31:24 UTC+1, Marc Tamlyn wrote:
>>
>> This is probably a slight error in the documentation, however what you
>> really want to use is the `render()` function when you want a request
>> context.
>>
>> See https://docs.djangoproject.com/en/1.8/topics/http/shortcuts/#render
>>
>> On 7 April 2015 at 11:28, Stephen Brooks <[email protected]> wrote:
>>
>>> I note from the release notes for Django 1.8 https://docs.djangoproject.
>>> com/en/1.8/releases/1.8/ the remark under the section:
>>> "dictionary and context_instance arguments of rendering functions" (which
>>> includes django.shortcuts.render_to_response())
>>>
>>> "If you’re passing a Context
>>> <https://docs.djangoproject.com/en/1.8/ref/templates/api/#django.template.Context>
>>> in context_instance, pass a dict
>>> <https://docs.python.org/3/library/stdtypes.html#dict> in the context
>>> parameter instead. If you’re passing a RequestContext
>>> <https://docs.djangoproject.com/en/1.8/ref/templates/api/#django.template.RequestContext>,
>>> pass the request separately in the *request *parameter."
>>>
>>> However, render_to_response* does not have a request parameter*. Is
>>> that an omission?
>>>
>>> I use the following idiom quite a lot:
>>>
>>> response = render_to_response('some_template.html', {'foo': 'bar'},
>>> RequestContext(request))
>>>
>>> If the passing of a context_instance is now to be avoided, I would
>>> expect to be able pass in the request object directly to
>>> render_to_response. Otherwise how are the context processors to do their
>>> job?
>>>
>>> -- Stephen
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Django developers (Contributions to Django itself)" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to [email protected].
>>> To post to this group, send email to [email protected].
>>> Visit this group at http://groups.google.com/group/django-developers.
>>> To view this discussion on the web visit https://groups.google.com/d/
>>> msgid/django-developers/e9b54373-9901-4a5a-8101-
>>> 89b6a7cedaf6%40googlegroups.com
>>> <https://groups.google.com/d/msgid/django-developers/e9b54373-9901-4a5a-8101-89b6a7cedaf6%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>  --
> You received this message because you are subscribed to the Google Groups
> "Django developers (Contributions to Django itself)" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/django-developers.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-developers/2066cb5c-514e-4ccb-bd5e-442f7b2d60ea%40googlegroups.com
> <https://groups.google.com/d/msgid/django-developers/2066cb5c-514e-4ccb-bd5e-442f7b2d60ea%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/CAMwjO1Ejtx%2BaQvSczLAR%3DdAPq%3D3nLMiBgZo68bj40WryOZw2LA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to