Opened 16 years ago

Closed 16 years ago

#4500 closed (duplicate)

Tutorial: What about the HttpResponseRedirect?

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


In the Tutorial it is not explained how to replace the final:

HttpResponseRedirect(reverse('mysite.polls.views.results', args=(,)))

in order to fit to the standard views of Django ;-)

Change History (3)

comment:1 Changed 16 years ago by Malcolm Tredinnick

Can you give an example of what you mean? Since views can be any Python function, "standard views" doesn't mean much.

comment:2 Changed 16 years ago by Mike <mikeshantz@…>

I noticed this as well.
I think what is meant is the following:

The text in tutorial04 ( needs a bit of an update.

In part 4 of the tutorial the /polls/ file is updated to "use generic views" (last section). This is being changed from the setup that was explained in part 3 (

Earlier in part 4 a view function called vote() is created. In this function there is a reverse lookup of a url using the setup from from part 3. The line is return HttpResponseRedirect(reverse('mysite.polls.views.results', args=(,))) .

When, in part 4, you are instructed on updating the vote() function to match the new "generic views" setup, there is no instruction for changing this line. The problem is that no url has been configured for the reverse lookup to get, and so pressing the vote button on http://localhost:8000/polls/1/vote/ yeilds a "NoReverseMatch at /polls/1/vote/" error.

comment:3 Changed 16 years ago by Chris Beaven

Resolution: duplicate
Status: newclosed

Dupe of the more verbose ticket #4615

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