Code

Opened 7 years ago

Closed 7 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.

Attachments (0)

Change History (1)

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

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

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.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.