首页 > django中render_to_response函数的参数问题

django中render_to_response函数的参数问题

def some_view(request):
    return render_to_response('my_template.html', my_data_dictionary, context_instance=RequestContext(request))

请问有高人知道最后一个参数 context_instance=RequestContext(request) 的具体意义和用法吗 看别人的代码经常看到 但是不知道这个的具体用处 求解答


官方文档:

context_instance
The context instance to render the template with. By default, the template will be rendered with a RequestContext instance (filled with values from request and dictionary).


https://docs.djangoproject.com/en/dev/topics/http/shortcuts/#django.shortcuts.render_to_response

【热门文章】
【热门文章】