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?