def render_to_response_with_context_processors(template_name, request,
args={}):
"""
this function was written to provide a "shortcut" when using
context processors
if i use this a lot i'll come up with a better (shorter) name
"""
t = template_loader.get_template(template_name)
c = RequestContext(request, args)
return HttpResponse(t.render(c))
this is the only way i could get context processors specified in the
setting TEMPLATE_CONTEXT_PROCESSORS to be run in a view. i basically
want to know if what i do is the "correct" way of doing things and also
if there are other way of getting context processors to run. (i.e. not
having to invoke RequestContext)?
render_to_response takes an optional 'context_instance' argument which
can tell it to use RequestContext or any other subclass of Context you
might have defined, instead of the default.
--
"May the forces of evil become confused on the way to your house."
-- George Carlin