Hmm, I stand corrected:

https://github.com/django/django/blob/1.7.3/django/template/response.py#L156

It does render the context via RequestContext().

However, I can also point out why I thought I was right (in addition to my
apparently flawed/rushed test):

https://github.com/django/django/blob/master/django/template/response.py#L188

In that function definition, you'll see that RequestContext() is never
called/rendered before being passed back to the parent class methods, nor
do they override the resolve_context() method. Doh!

It appears that in the current master branch and 1.8a1, that Context() is
on its way out (or is getting a major refactoring), and everything is
moving to RequestContext(). The RN are a bit sketchy on this topic still.

https://docs.djangoproject.com/en/dev/releases/1.8/#dictionary-and-context-instance-arguments-of-rendering-functions

That aside though, I re-ran my quick test a bit under 1.7.3 a bit more
formally using a blank project with as basic of a config as I could with
the debug toolbar, a single app, and a single template. My urls.py
referenced django.contrib.auth.views.password_reset. The only change to the
default settings was adding django.core.context_processors.request to
TEMPLATE_CONTEXT_PROCESSORS. After throwing a {{ request }} in my template,
a ton of WSGI garbage in the request made me red in the face. Debug toolbar
also confirmed the context processors ran. As would be expected.

Not sure what happened with my other test, I probably ran through it with
too much confidence after viewing the wrong branch of source code.

Apologies.

-James


On Wed, Jan 21, 2015 at 3:19 PM, Tom Evans <tevans...@googlemail.com> wrote:

> On Wed, Jan 21, 2015 at 2:31 PM, Mark Rogaski <mroga...@pobox.com> wrote:
> > Thanks, James.  I think the call to TemplateResponse is fine, but the
> > context that's passed as a dict needs to be passed as a ContextRequest
> > instead.
>
>
> https://docs.djangoproject.com/en/1.7/ref/template-response/#django.template.response.TemplateResponse
>
> "TemplateResponse is a subclass of SimpleTemplateResponse that uses a
> RequestContext instead of a Context."
>
> So something else is going awry. Fire up a shell and confirm the value
> of settings.TEMPLATE_CONTEXT_PROCESSORS is what you expect it to be.
>
> Cheers
>
> Tom
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAFHbX1%2BcUM13fdrEwXykLuWdsTb7uevz0kMQahY5TCioCv38EA%40mail.gmail.com
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CA%2Be%2BciVOWrNYUVUrtPhRK%3DDOHp9TrvMDCcpydm7VZb8BcRQU1Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to