[Django] #20952: Django 1.5 Tutorial Part 3, Test after Update of Polls/urls.py Fails

22 views
Skip to first unread message

Django

unread,
Aug 21, 2013, 11:41:23 AM8/21/13
to django-...@googlegroups.com
#20952: Django 1.5 Tutorial Part 3, Test after Update of Polls/urls.py Fails
--------------------------------------+--------------------
Reporter: diek@… | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Documentation | Version: 1.5
Severity: Normal | Keywords: views
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------------+--------------------
Good day,
I really appreciate the effort that you put forth. I hit a bit of wall
last night, and perhaps should have picked up on it myself but I did the
tutorials 1-3 back to back and maybe my brain was not %100. The test
recommended after the user changes urls: "The next step is "Take a look in
your browser, at “/polls/34/”. Unless the user has added another 33
records to polls_poll this fails, the majority of users would not have
done that. It works perfect with /polls/1/. Using '34' is very confusing,
especially for new users. I think it needs clarification which would need
maybe one sentence.

Thank you,

derrick

--
Ticket URL: <https://code.djangoproject.com/ticket/20952>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Aug 21, 2013, 12:02:09 PM8/21/13
to django-...@googlegroups.com
#20952: Django 1.5 Tutorial Part 3, Test after Update of Polls/urls.py Fails
-------------------------------------+-------------------------------------
Reporter: diek@… | Owner: nobody
Type: | Status: closed
Cleanup/optimization | Version: 1.5
Component: Documentation | Resolution:
Severity: Normal | worksforme
Keywords: views | Triage Stage:
Has patch: 0 | Unreviewed
Needs tests: 0 | Needs documentation: 0
Easy pickings: 0 | Patch needs improvement: 0
| UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by timo):

* status: new => closed
* needs_better_patch: => 0
* resolution: => worksforme
* needs_tests: => 0
* needs_docs: => 0


Comment:

At that point in the tutorial, we've only stubbed out the views with
something like `return HttpResponse("You're looking at poll %s." %
poll_id)` -- there's no database operation yet. It sounds like you're
following the tutorial out of order.

--
Ticket URL: <https://code.djangoproject.com/ticket/20952#comment:1>

Django

unread,
Aug 21, 2013, 12:08:51 PM8/21/13
to django-...@googlegroups.com
#20952: Django 1.5 Tutorial Part 3, Test after Update of Polls/urls.py Fails
-------------------------------------+-------------------------------------
Reporter: diek@… | Owner: nobody

Type: | Status: closed
Cleanup/optimization | Version: 1.5
Component: Documentation | Resolution:
Severity: Normal | worksforme
Keywords: views | Triage Stage:
Has patch: 0 | Unreviewed
Needs tests: 0 | Needs documentation: 0
Easy pickings: 0 | Patch needs improvement: 0
| UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by diek@…):

Good Morning,
I did not follow them out of order. If you look at tut 3, for 1.5. This is
an exact quote from Part 3, Writing more views: "Take a look in your
browser, at “/polls/34/”. It’ll run the detail() method and display
whatever ID you provide in the URL. Try “/polls/34/results/” and
“/polls/34/vote/” too – these will display the placeholder results and
voting pages."

I imagine you are volunteer, but I have to say closing my topic without
giving a chance to explain was a bit premature.

derrick

--
Ticket URL: <https://code.djangoproject.com/ticket/20952#comment:2>

Django

unread,
Aug 21, 2013, 12:10:13 PM8/21/13
to django-...@googlegroups.com
#20952: Django 1.5 Tutorial Part 3, Test after Update of Polls/urls.py Fails
-------------------------------------+-------------------------------------
Reporter: diek@… | Owner: nobody
Type: | Status: new

Cleanup/optimization | Version: 1.5
Component: Documentation | Resolution:
Severity: Normal | Triage Stage:
Keywords: views | Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by diek@…):

* status: closed => new
* resolution: worksforme =>


--
Ticket URL: <https://code.djangoproject.com/ticket/20952#comment:3>

Django

unread,
Aug 21, 2013, 12:58:21 PM8/21/13
to django-...@googlegroups.com
#20952: Django 1.5 Tutorial Part 3, Test after Update of Polls/urls.py Fails
-------------------------------------+-------------------------------------
Reporter: diek@… | Owner: nobody

Type: | Status: new
Cleanup/optimization | Version: 1.5
Component: Documentation | Resolution:
Severity: Normal | Triage Stage:
Keywords: views | Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by timo):

It will display a placeholder page, won't it? There isn't any fetching
from the database in the views that have been implemented thus far:
{{{
def detail(request, poll_id):


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

def results(request, poll_id):
return HttpResponse("You're looking at the results of poll %s." %
poll_id)

def vote(request, poll_id):
return HttpResponse("You're voting on poll %s." % poll_id)
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/20952#comment:4>

Django

unread,
Aug 21, 2013, 7:26:47 PM8/21/13
to django-...@googlegroups.com
#20952: Django 1.5 Tutorial Part 3, Test after Update of Polls/urls.py Fails
-------------------------------------+-------------------------------------
Reporter: diek@… | Owner: nobody

Type: | Status: new
Cleanup/optimization | Version: 1.5
Component: Documentation | Resolution:
Severity: Normal | Triage Stage:
Keywords: views | Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by diek@…):

timo,
From the tutorial https://docs.djangoproject.com/en/1.5/intro/tutorial03/,
right after what you have written it states:
"Take a look in your browser, at “/polls/34/”. It’ll run the detail()


method and display whatever ID you provide in the URL. Try
“/polls/34/results/” and “/polls/34/vote/” too – these will display the

placeholder results and voting pages." '''This fails because there is no
record 34.''' There is a record 1, and as I discovered it works with
polls/1/. Here is my concern, you are an expert but someone like myself is
brand new to django. When I read a tutorial I follow it step by step. As a
beginner I have to trust a tutorial, that has been written and edited
several times; when I get an error, I do not doubt the tutorial and I
think I did something incorrect. The topic is slightly complicated as
well, so I do not understand why the tutorial would use record 34, all it
did is cause confusion. And really I cannot understand why you would not
remove 34, or explain that you need to use an existing id. Again please
try to look at this from a new learner's perspective and not an expert.

Thank you,

derrick

--
Ticket URL: <https://code.djangoproject.com/ticket/20952#comment:5>

Django

unread,
Aug 21, 2013, 7:41:19 PM8/21/13
to django-...@googlegroups.com
#20952: Django 1.5 Tutorial Part 3, Test after Update of Polls/urls.py Fails
-------------------------------------+-------------------------------------
Reporter: diek@… | Owner: nobody

Type: | Status: new
Cleanup/optimization | Version: 1.5
Component: Documentation | Resolution:
Severity: Normal | Triage Stage:
Keywords: views | Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by timo):

There shouldn't be a failure because the views (up to this point) simply
display whatever ID you pass in the URL. The code does not verify that a
poll with the given ID actually exists. Please tell me if I'm wrong.

--
Ticket URL: <https://code.djangoproject.com/ticket/20952#comment:6>

Django

unread,
Aug 21, 2013, 7:59:50 PM8/21/13
to django-...@googlegroups.com
#20952: Django 1.5 Tutorial Part 3, Test after Update of Polls/urls.py Fails
-------------------------------------+-------------------------------------
Reporter: diek@… | Owner: nobody

Type: | Status: new
Cleanup/optimization | Version: 1.5
Component: Documentation | Resolution:
Severity: Normal | Triage Stage:
Keywords: views | Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by diek@…):

timo,
Ohhh man do I feel dumb. I just checked it again. You are correct, it
works perfectly with 34. Obviously I was doing something wrong.

My apologies. I will reread Part 3 again, I am obviously not understanding
it as well as I should.

derrick

--
Ticket URL: <https://code.djangoproject.com/ticket/20952#comment:7>

Django

unread,
Aug 21, 2013, 8:09:03 PM8/21/13
to django-...@googlegroups.com
#20952: Django 1.5 Tutorial Part 3, Test after Update of Polls/urls.py Fails
-------------------------------------+-------------------------------------
Reporter: diek@… | Owner: nobody
Type: | Status: closed

Cleanup/optimization | Version: 1.5
Component: Documentation | Resolution:
Severity: Normal | worksforme
Keywords: views | Triage Stage:
Has patch: 0 | Unreviewed
Needs tests: 0 | Needs documentation: 0
Easy pickings: 0 | Patch needs improvement: 0
| UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by timo):

* status: new => closed

* resolution: => worksforme


Comment:

No problem, sorry it took me so long to convey my point. If you have any
other suggestions, don't hesitate to let us know.

--
Ticket URL: <https://code.djangoproject.com/ticket/20952#comment:8>

Reply all
Reply to author
Forward
0 new messages