Opened 8 years ago
Last modified 8 years ago
#28125 closed Cleanup/optimization
Clarify 1.11 release notes about which Template class prohibits non-dict contexts — at Version 1
Reported by: | Eddie Bragg | Owned by: | Tim Graham |
---|---|---|---|
Component: | Documentation | Version: | 1.11 |
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 )
According to the release docs for 1.11 any call to render()
on a Template
object you need to pass a dict
https://docs.djangoproject.com/en/1.11/releases/1.11/#django-template-render-prohibits-non-dict-context
I have code that originally passes a Context
object.
Upgrading to 1.11 from 1.10 and changing it to a dict
causes this error 'dict' object has no attribute 'render_context'
Looking at Django code the error occurs at https://github.com/django/django/blob/1.11/django/template/base.py#L203
I believe this code still expects a Context
object.
Change History (1)
comment:1 by , 8 years ago
Component: | Template system → Documentation |
---|---|
Description: | modified (diff) |
Owner: | changed from | to
Status: | new → assigned |
Summary: | Calling render on a Template object passing a dict fails → Clarify 1.11 release notes about which Template class prohibits non-dict contexts |
Type: | Bug → Cleanup/optimization |
This is a confusion between
django.template.backends.django.Template
, which the release notes are meant to refer to, anddjango.template.base.Template
. I'll clarify the release notes.