如何将“render_to_response 参数”传递给新视图?
def show_list(request, id):
try:
profile = request.user.get_profile()
list = Lista.objects.get(user_profile = profile)
except Lista.DoesNotExist:
c = {}
c.update(csrf(request))
titlepage = "ooops, you don't have a list YET! click on button to create one!"
c = {'profile' : profile, 'request' : request, 'titlepage' : titlepage}
return render_to_response('/profiles/list/create/',c,context_instance=RequestContext(request))
最后一行这不起作用,url /profiles/list/create/ 重定向到视图 create_list。
好吧,我知道我可以编写类似 redirect(/profiles/list/create/) 的东西,但是这样我就不能通过字典 c。
提前致谢