Opened 8 years ago

Closed 8 years ago

#27770 closed Uncategorized (duplicate)

{% include %} with the template instance is broken under django 1.11

Reported by: Mikhail Podgurskiy Owned by: nobody
Component: Uncategorized Version: 1.11
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

As stated in the django docs, the {% include %} tag could accept a template instance to render - https://docs.djangoproject.com/en/1.10/ref/templates/builtins/#include

include

Loads a template and renders it with the current context. This is a way of “including” other templates within a template.

The variable may also be any object with a render() method that accepts a context. This allows you to reference a compiled Template in your context.

This leads to RequestContext from the main template been passed to the included template.render method and this became prohibited within https://code.djangoproject.com/ticket/27258 changeset

TypeError at ...
context must be a dict rather than RequestContext.

Change History (1)

comment:1 by Tim Graham, 8 years ago

Resolution: duplicate
Status: newclosed

Duplicate of #27722 which already has discussion.

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