[Answer]-Render_to_response multiple args

1👍

args = {}
args.update(csrf(request))

args['form'] = form
args['authors'] = Author.objects.all()
return render_to_response('tasks/task1.html',args)

0👍

return render_to_response('tasks/task1.html', {'authors':Author.objects.all(),'foo':foo,'bar':bar})

or

args = {'authors':Author.objects.all(),'foo':foo,'bar':bar}
return render_to_response('tasks/task1.html',args)

note that you can simply use render instead of render_to_response from django >= 1.3

👤taesu

Leave a comment