From 01d8c6ea132d1313324123465db1a331354047c8 Mon Sep 17 00:00:00 2001 From: Josh Flatt Date: Sat, 22 Nov 2025 21:01:43 -0600 Subject: [PATCH] added results page --- polls/templates/polls/results.html | 9 +++++++++ polls/views.py | 4 ++-- 2 files changed, 11 insertions(+), 2 deletions(-) create mode 100644 polls/templates/polls/results.html diff --git a/polls/templates/polls/results.html b/polls/templates/polls/results.html new file mode 100644 index 0000000..33b67b2 --- /dev/null +++ b/polls/templates/polls/results.html @@ -0,0 +1,9 @@ +

{{ question.question_text }}

+ + + +Vote again? \ No newline at end of file diff --git a/polls/views.py b/polls/views.py index d5dc34d..4ad7048 100644 --- a/polls/views.py +++ b/polls/views.py @@ -20,8 +20,8 @@ def detail(request, question_id): def results(request, question_id): - response = "You're looking at the results of question %s." - return HttpResponse(response % question_id) + question = get_object_or_404(Question, pk=question_id) + return render(request, "polls/results.html", {"question": question}) def vote(request, question_id):