In continuation of the topic RequestContext.

Hi, tell me, please, the docks say that RequestContext adds a group of variables to the template context, as follows:

def custom_proc(request): return {'name': 'Влад', 'nick': 'johniek_comp', 'age': 17} def myView(request): return render_to_response('template.html', {}, context_instanse=RequestContext(request, processors = [custom_proc[)) 

And in the answer that you sent me there was no processors parament

 def index(request): render_to_response('index.html', {}, context_instance=RequestContext(request)) 

How in this case (ie why) is RequestContext used?

Thank.



    1 answer 1

    RequestContext is a class that collects all used TEMPLATE_CONTEXT_PROCESSORS context handlers from the settings and passed to the direct through a variable from the current question (not mandatory) and returns the result of their execution in the form of a dictionary. Usually the creation of this class is inserted into the render call, which automatically transfers the dictionary with variables to the call ...