0
votes

I am getting the following error when following the Django tutorial, V1.7

'>>> Poll.objects.all()
Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/local/lib/python2.7/dist-packages/django/db/models/query.py", line 74, in __repr__
    return repr(data)
  File "/usr/local/lib/python2.7/dist-packages/django/db/models/base.py", line 423, in __repr__
    u = six.text_type(self)
  File "/home/michael/workspace/mysite/polls/models.py", line 7, in __unicode__
    return self.question
AttributeError: 'Poll' object has no attribute 'question''
1
What is the content of your polls/models.py?tjati

1 Answers

0
votes

It looks like you've mixed up different versions of the tutorial. The tutorial for Django 1.7 has Question and Choice models, but it does not have a Poll model.

You can change the version of the documentation using the selector in the bottom right hand corner. Make sure you have the right version for the version of Django you are using, and stick to it!