Writing your first Django app, part 3

Help me please with 3rd part of the tutorial on official Django site.
I’ve finished 2 first lesson with no problem, but in the part 3 on step of writing function “index” Pycharm says that attribute “objects” is unknown.
-------------- My code ----------------
def index(request):
latest_question_list = Question.objects.order_by(‘-pud_date’)[:5]
output = ', '.join([q.question_text for q in latest_question_list])
return output

Message from computer Unresolved attribute reference “objects” for class Question.
How could I fix this?
PS I’m using Pycharm Community version.

That’s a configuration issue with PyCharm. I’m sure there’s a way to set something to prevent the error from appearing, but it shouldn’t prevent your code from running. (Specifically, this is not a Django-issue, it’s a PyCharm issue. You might want to check their web site for docs related to this.)

Thank you.
I’ve fixed it with help of a command “pip install django-stubs” and Pycharm’s seen function “objects”. But there was other mistake - I didn’t use command “HttpResponse” in return of the function. That’s why mistake on web-page appeared.