On 21.09.2011, at 11:24, Jannis Leidel wrote:

> On 21.09.2011, at 11:14, Tom Christie wrote:
> 
>> Heya,
>> 
>> Thanks for the feedback.  I quite like the explicit 'STATIC_URL' only 
>> approach, although I think a lot of users would still run into a problem 
>> there, because 'request' isn't also added in explicitly to the Context...
>> 
>>  For context, my particular use case is a simple '500.html' template, that 
>> extends a 'base.html' template.  I don't use any other context in the base 
>> template other than 'request' and 'STATIC_URL'.  In the case of a 500 error, 
>> I'd see the template render correctly, except that it'd look like the user 
>> isn't logged in.  Coming across that as a dev that'd confuse the hell out of 
>> me the first time I came across it unless I already understood the 500 
>> Context behavior, and it's not ideal from the end-user perspective either.
>> 
>>  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

Oh, I forgot to say, there is of course also a non-staticfiles version
of the {% static %} template tag in case you don't use the contrib app
staticfiles:

  https://docs.djangoproject.com/en/dev/ref/templates/builtins/#static

Jannis

-- 
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