Opened 3 years ago

Closed 3 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 Changed 3 years ago by kmike

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to invalid
  • Status changed from new to closed

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