CSS word-wrap:break-word;
, протестировано в FireFox 3.6.3
Ваше намерение имеет смысл, большую часть времени вам понадобится RequestContext
, и лишь в редких случаях его можно безопасно опустить из соображений производительности. Решение простое, вместо render_to_response
используйте ярлык direct_to_template
:
from django.views.generic.simple import direct_to_template
def contact(request):
# snip ...
return direct_to_template(request, 'contact.html', { 'myvar' : myvar })
... или render_to
декоратор из django-раздражает :
from annoying.decorators import render_to
@render_to('template.html')
def foo(request):
bar = Bar.object.all()
return {'bar': bar}
You don't necessarily have to do anything to the markup of your navigation to give the current one a different style - there are declarative ways to do that using CSS.
See my answer here: Django: Is there a better way to bold the current page link for an example.