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
- [Answer]-How to get raven to report Django runscript exceptions to Sentry?
- [Answer]-Model friends table in Django
- [Answer]-Django template rendering extend tag incorrectly
Source:stackexchange.com