Opened 13 years ago

Closed 13 years ago

#18032 closed Uncategorized (invalid)

Inaccuracy of the documentation

Reported by: pkolt@… Owned by: nobody
Component: Documentation Version: 1.4
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

https://docs.djangoproject.com/en/1.4/ref/template-response/#using-templateresponse-and-simpletemplateresponse

from django.template.response import TemplateResponse

def blog_index(request):
    return TemplateResponse(request, 'entry_list.html', {'entries': Entry.objects.all()})

Must:

from django.template.response import TemplateResponse

def blog_index(request):
    return TemplateResponse(request, 'entry_list.html', {'entries': Entry.objects.all()}).render()

Change History (1)

comment:1 by Mikhail Korobov, 13 years ago

Resolution: invalid
Status: newclosed

The example is correct. 'render' method is called internally by django at later stages. See https://docs.djangoproject.com/en/dev/ref/template-response/#the-rendering-process

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