Opened 10 years ago

Closed 10 years ago

#4095 closed (invalid)

'Writing your first Django app, part 3' is incomplete

Reported by: pigletto@… Owned by: Jacob
Component: Documentation Version:
Severity: Keywords: tutorial
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

http://www.djangoproject.com/documentation/tutorial03/

There are few inconsistences in this part of tutorial. In general you seem to forgot about 'detail' method.

  1. Section: "A shortcut: render_to_response()" says:

"Note that once we’ve done this in all these views, we no longer need to import loader, Context and HttpResponse."

while at this point we still have method 'detail' defined as follows:

def detail(request, poll_id):

return HttpResponse("You're looking at poll %s." % poll_id)

So removing HttpResponse import breaks code.

  1. Sections: "Raising 404" and "A shortcut: get_object_or_404()" are changing

'detail' method so it contains reference to: detail.html file, eg.:

return render_to_response('polls/detail.html', {'poll': p})

but there is nothing about creating 'detail.html' in this tutorial. Furthermore, in
part IV of the tutorial, there is statement:
"Let’s update our poll detail template from the last tutorial, so that the template contains an HTML <form> element:"
but we have no 'detail.html' template.

Change History (1)

comment:1 Changed 10 years ago by Simon G. <dev@…>

Resolution: invalid
Status: newclosed

Thanks for the report, but I'm marking this as invalid for the following reasons:

1) yes, HttpResponse is still needed at that point, but only for another five lines.

2) yes, you haven't created detail.html yet - it's coming. After a brief digression into 500/404 views (which really are quite important), detail.html is created in Use the template system.

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