Hey Jannis,
> https://docs.djangoproject.com/en/dev/releases/1.4/#static-template-tag
That's rather nice.
> Adding the request is a non-starter, IMO; the "request" context
> processor isn't even in the default list of TEMPLATE_CONTEXT_PROCESSORS,
> so this would mean adding something to the 500 page context that isn't
> even added by RequestContext by default. If you want the request object
> in your 500 page, you're well into custom handler500 territory.
Yeah, that's me being stupid! I should really have been talking about
having 'user' available, given that
'django.contrib.auth.context_processors.auth' _is_ enabled in
TEMPLATE_CONTEXT_PROCESSORS.
So you _could_ argue that returning 'Context({'user': request.user})' would
be a more useful default than the current empty context.
However I think I'm convinced by Carls point that attempting to do things
with 'user' inside a 500 view might not be best practice in any case.
Thanks for the input both. I've linked from the bugs to here. Should be
nice and clear for anyone hitting them again in the future.
I'm considering making the doc's on the 500
view<https://docs.djangoproject.com/en/dev/topics/http/views/#the-500-server-error-view>more
obviously explicit about the use of Context, not RequestContext, as
it's a bit of a gotcha, and reasonably easy to miss. IE, putting the text
"...is
rendered with an empty Context..." into a Note block to make it more
obvious. I'll submit a separate bug and patch for that when I've got a
moment.
Cheers,
Tom
--
You received this message because you are subscribed to the Google Groups
"Django developers" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/django-developers/-/j2p7-vE7ZM0J.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/django-developers?hl=en.