diff --git a/LCAdmin/polls/urls.py b/LCAdmin/polls/urls.py index 3ef24d9..94083df 100644 --- a/LCAdmin/polls/urls.py +++ b/LCAdmin/polls/urls.py @@ -4,4 +4,12 @@ from . import views urlpatterns = [ path('', views.index, name='index'), + # ex: /polls/ + path('', views.index, name='index'), + # ex: /polls/5/ + path('/', views.detail, name='detail'), + # ex: /polls/5/results/ + path('/results/', views.results, name='results'), + # ex: /polls/5/vote/ + path('/vote/', views.vote, name='vote'), ] \ No newline at end of file diff --git a/LCAdmin/polls/views.py b/LCAdmin/polls/views.py index 363c279..d5f37f2 100644 --- a/LCAdmin/polls/views.py +++ b/LCAdmin/polls/views.py @@ -5,4 +5,14 @@ from django.http import HttpResponse def index(request): - return HttpResponse("Hello, world. You're at the polls index.") \ No newline at end of file + return HttpResponse("Hello, world. You're at the polls index.") + +def detail(request, question_id): + return HttpResponse("You're looking at question %s." % question_id) + +def results(request, question_id): + response = "You're looking at the results of question %s." + return HttpResponse(response % question_id) + +def vote(request, question_id): + return HttpResponse("You're voting on question %s." % question_id) \ No newline at end of file