1
0
mirror of https://github.com/django/django.git synced 2024-12-22 00:55:44 +00:00

Made index view examples consistent in tutorial by removing trailing comma.

This commit is contained in:
Ülgen Sarıkavak 2024-11-23 13:25:06 +03:00 committed by Sarah Boyce
parent 55855bc6d0
commit c075d4c2c8

View File

@ -234,9 +234,7 @@ Now let's update our ``index`` view in ``polls/views.py`` to use the template:
def index(request):
latest_question_list = Question.objects.order_by("-pub_date")[:5]
template = loader.get_template("polls/index.html")
context = {
"latest_question_list": latest_question_list,
}
context = {"latest_question_list": latest_question_list}
return HttpResponse(template.render(context, request))
That code loads the template called ``polls/index.html`` and passes it a