#28125 closed Cleanup/optimization (fixed)
Clarify 1.11 release notes about which Template class prohibits non-dict contexts
| 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 (4)
comment:1 by , 9 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.