def some_view(request):
return render_to_response('my_template.html', my_data_dictionary, context_instance=RequestContext(request))
请问有高人知道最后一个参数 context_instance=RequestContext(request) 的具体意义和用法吗 看别人的代码经常看到 但是不知道这个的具体用处 求解答
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).
4 回答4.4k 阅读✓ 已解决
4 回答3.8k 阅读✓ 已解决
1 回答3k 阅读✓ 已解决
3 回答2.1k 阅读✓ 已解决
1 回答4.5k 阅读✓ 已解决
1 回答3.8k 阅读✓ 已解决
1 回答2.8k 阅读✓ 已解决
https://docs.djangoproject.com/en/dev/topics/http/shortcuts/#django.shortcuts.render_to_response