Opened 9 years ago
Last modified 8 years ago
#25854 closed Bug
Bad warning when using template.render — at Version 1
Reported by: | stephanm | Owned by: | nobody |
---|---|---|---|
Component: | Documentation | Version: | 1.8 |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Accepted | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description (last modified by )
I am just switching from django 1.8.7 to 1.9 and stumbled on
a strange warning.
I have the similar code snippet in my view as explained in:
https://docs.djangoproject.com/en/1.9/intro/tutorial03/#write-views-that-actually-do-something
... template = loader.get_template('polls/index.html') context = RequestContext(request, { }) return HttpResponse(template.render(context))
Now I get the warning:
RemovedInDjango110Warning: render() must be called with a dict, not a RequestContext.
I am not sure how to work around this problem.
Is it forbidden to use RequestContext in template.render(..)
if yes, howto must I transform RequestContext in a dict.
In this case the documentation should be actualized.
By the way: can I download the tutorial poll application project somewhere?