#28125: Clarify 1.11 release notes about which Template class prohibits non-dict
contexts
-------------------------------------+-------------------------------------
     Reporter:  Eddie Bragg          |                    Owner:  Tim
         Type:                       |  Graham
  Cleanup/optimization               |                   Status:  assigned
    Component:  Documentation        |                  Version:  1.11
     Severity:  Normal               |               Resolution:
     Keywords:                       |             Triage Stage:
                                     |  Unreviewed
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Changes (by Tim Graham):

 * status:  new => assigned
 * component:  Template system => Documentation
 * owner:  nobody => Tim Graham
 * type:  Bug => Cleanup/optimization


Old description:

> According to the release docs for 1.11 any callto `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.

New description:

 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.

--

Comment:

 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.

--
Ticket URL: <https://code.djangoproject.com/ticket/28125#comment:1>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/068.8f5f4d650bddc0ad6360eea1f65cf89f%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to