Hello, I am practicing the tutorial part 5, Test and I got an error I can solve.
(mientorno) C:\Users\user1\djangowom>python manage.py shell
Python 3.6.3 (v3.6.3:2c5fed8, Oct 3 2017, 18:11:49) [MSC v.1900 64 bit (AMD64)]
on win32
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)
>>>
>>>
>>>
>>> import datetime
>>> from django.utils import timezone
>>> from polls.models import Question
>>> future_question = Question(pub_date=timezone.now() + datetime.timedelta(days=30))
>>> future_question.was_published_recently()
Traceback (most recent call last):
File "<console>", line 1, in <module>
File "C:\Users\arojas\djangowom\polls\models.py", line 12, in was_published_re
cently
return self.pub_date >= timezone.now() - datetime.timedelta(days=1)
AttributeError: type object 'datetime.datetime' has no attribute 'timedelta'
>>>
Any idea? Thanks a lot.