Code

#19275 closed Bug (invalid)

small bug in tutorial code

Reported by: ryanmcneely@… Owned by: nobody
Component: Documentation Version: 1.4
Severity: Normal Keywords: Tutorial, Template
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Hello!
I'm working through your tutorial (which is great, by the way), and I've found a small problem with the 'detail.html' template code in part 4 of the tutorial.

You have this on line 5 (i've removed the brackets):

form action="/polls/{{ poll.id }}/vote/" method="post"

This produces a 404 error which says "...polls/1/vote cannot be found."

The tutorial suggests that this action SHOULD take us to the results page, which it doesn't until I replace the word 'vote' with 'results' on the same line:

form action="/polls/{{ poll.id }}/results/" method="post"

This fixes the problem, but I just want to make sure I'm not screwing something up by doing this, so I humbly present my findings to you for review.

I have attached a screen shot.

thank you!

RYAN.

Attachments (0)

Change History (3)

comment:1 Changed 20 months ago by anonymous

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

The screen shot was too bit, so I didn't attach it.

comment:2 Changed 20 months ago by anonymous

OK! I went back through everything I'd done so far in the tutorial to make sure the error wasn't mine, and I found that it WAS, in fact, me that made the mistake.
I accidentally wrote this:

url(r'(?P<poll_id>\d+)/vote$','vote'),

instead of this:

url(r'(?P<poll_id>\d+)/vote/$','vote'),

in the URLconf file in the polls/ directory.

sorry to have wasted your time!

have a lovely day,

RYAN.

comment:3 Changed 20 months ago by timo

  • Resolution set to invalid
  • Status changed from new to closed

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.