#21764 closed Uncategorized (duplicate)

Tutorial 5 typo in example session

Reported by: Don.Morton@… Owned by: nobody
Component: Documentation Version: 1.6
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


Hello, I believe there is a typo in your sample code at


Under "The Django test client" section, there is a code box of interactive stuff. The large code box is prefaced with, "With that ready, we can ask the client to do some work for us:"

and the last statement in the code box looks like:

>>> response.context['latest_poll_list']
[<Poll: Who is your favorite Beatle?>]

When I execute this, I get:

In [25]: response.context['latest_poll_list']
TypeError                                 Traceback (most recent call last)
/home/morton/DjangoTesting/mysite/<ipython-input-25-439e12041dea> in <module>()
----> 1 response.context['latest_poll_list']

TypeError: 'NoneType' object has no attribute '__getitem__'

When I look at the next section of the tutorial, they mention the item


and when I try to look at that, rather than the suggested


it seems to work as I would expect.

I'm just learning so maybe I'm wrong :)

Change History (1)

comment:1 Changed 23 months ago by timo

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

This has been reported before in #21017, but I think the text is correct as it is. Please double check you are following the instructions exactly.

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