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 Tim Graham)

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 Tim Graham, 8 years ago

Component: Template systemDocumentation
Description: modified (diff)
Owner: changed from nobody to Tim Graham
Status: newassigned
Summary: Calling render on a Template object passing a dict failsClarify 1.11 release notes about which Template class prohibits non-dict contexts
Type: BugCleanup/optimization

This is a confusion between django.template.backends.django.Template, which the release notes are meant to refer to, and django.template.base.Template. I'll clarify the release notes.

Note: See TracTickets for help on using tickets.
Back to Top