In Django, whenever I need to access messages or the user instance, I need to do this:
return render_to_response('news.html', {"articles": articles}, context_instance=RequestContext(request))
Is there any way to make this default behavior? This is part of my settings.py file:
TEMPLATE_CONTEXT_PROCESSORS = (
"django.contrib.auth.context_processors.auth",
"django.core.context_processors.debug",
"django.core.context_processors.i18n",
"django.core.context_processors.media",
"django.core.context_processors.static",
"django.core.context_processors.tz",
"django.contrib.messages.context_processors.messages"
)
I don’t want to specify the context_instance whenever I want to render a template.
If you are using Django 1.3+ you can use
renderinstead: