1👍
✅
return render_to_response('search.html', dictionary, request)
You’re passing the request as a context instance, while you should pass an instance of django.template.Context
(though you probably want to use its subclass RequestContext
).
👤knbk
1👍
You’ve correctly used the new render
shortcut in the last line. In the line before the else clause, though, you’ve used the older render_to_response
and passed request as the last parameter. You should use render
there too, with request as the first param:
return render(request, 'search.html', dictionary)
- [Answered ]-How can I write my own OrderedDict class in Python?
- [Answered ]-How to test a Django class-based view receives correct arguments?
- [Answered ]-Get gmail email using django allAuth
- [Answered ]-Django, Extend BaseUserManager,
- [Answered ]-How to resize an image in Python without using Pillow
Source:stackexchange.com