결과 페이지 만들기

- views.py 수정 
from django.shortcuts import get_object_or_404, render


def results(request, question_id):
 question = get_object_or_404(Question, pk=question_id)
 return render(request, 'polls/results.html', {'question': question})

- polls/results.html 작성 

<h1>{{ question.question_text }}</h1>

<ul>
{% for choice in question.choice_set.all %}
 <li>{{ choice.choice_text }} -- {{ choice.votes }} vote{{ choice.votes|pluralize }}</li>
{% endfor %}
</ul>

<a href="{% url 'polls:detail' question.id %}">Vote again?</a>