Opened 11 years ago

Closed 11 years ago

#6426 closed (fixed)

Documentation fault at #writing-custom-template-tags, load_template

Reported by: panni@… Owned by: nobody
Component: Documentation Version: master
Severity: Keywords: #writing-custom-template-tags, custom template tags, load_template
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


Auto-escaping considerations >> New in Django development version states:

def render(self, context):
    t = template.load_template('small_fragment.html')
    return t.render(Context({'var': obj}, autoescape=context.autoescape))

This simply won't work because you're referring to django.template.load_template, which doesn't exist.
You probably mean django.template.loader.get_template(), or render_to_string().

Change History (2)

comment:1 Changed 11 years ago by Chris Beaven

Triage Stage: UnreviewedAccepted

comment:2 Changed 11 years ago by Malcolm Tredinnick

Resolution: fixed
Status: newclosed

(In [7130]) Fixed a few errors in the documentation. Thanks, Matthew Flanagan, panni@… and adamv.

Fixed #6411, #6426, #6524, #6555.

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