Blog1 Shell Doubt

when i use the command
models.Article.objects.all()[0].createdAt
it is showing an error:

models.Article.objects.all()[0].createdAt
Traceback (most recent call last):
File “”, line 1, in
File “C:\Users\HP\Desktop\CBWebDevelopment\blog\env\lib\site-packages\django\db\models\query.py”, line 314, in getitem
return qs._result_cache[0]
IndexError: list index out of range

How to resolve this error?

Looks like your database is not updated , in order to do so try and run migrations .

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.