-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 09/21/2011 03:24 AM, Jannis Leidel wrote:
> On 21.09.2011, at 11:14, Tom Christie wrote:
>> I'd imagine that plenty of other setups would have a similar setup,
>> so you could argue that returning this:
>> 
>> Context({'STATIC_URL': settings.STATIC_URL, 'request': request})
>> 
>> would be an okay thing to do in the default 500 handler.
> 
> Passing STATIC_URL to the 500.html template is not needed anymore now
> that we've added a new {% static %} template tag:
> 
> https://docs.djangoproject.com/en/dev/releases/1.4/#static-template-tag

Ah, thanks, I'd forgotten about the new {% static %} tag. I agree that
this makes adding STATIC_URL to the handler500 context unnecessary.

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.

(IMO it's poor practice to have the 500 template inherit from your
site's normal base template; even if it works now, it's easy to
introduce things into your base template that could break under certain
500 error conditions. Better to have the 500 template standalone.
Likewise with having the 500 template display logged-in status: that
depends on the full session/auth stack, which likely depends on some
kind of external session store - the 500 error could easily be due to
that external store being unavailable in the first place!)

Carl
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk553OYACgkQ8W4rlRKtE2e4FwCcDRh9kZZO7syAP4BxfJF+0w2u
xhIAnAu9cYF9Mve4vVMIfkeSeTsOBhKx
=tnRL
-----END PGP SIGNATURE-----

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-developers@googlegroups.com.
To unsubscribe from this group, send email to 
django-developers+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en.

Reply via email to