adds more views for testing purposes
This commit is contained in:
parent
2b191e1421
commit
387b1b176f
Binary file not shown.
Binary file not shown.
|
@ -3,5 +3,8 @@ from django.urls import path
|
||||||
from . import views
|
from . import views
|
||||||
|
|
||||||
urlpatterns = [
|
urlpatterns = [
|
||||||
path("", views.index, name = "index")
|
path("", views.index, name = "index"),
|
||||||
|
path("<int:question_id>", views.detail, name="detail"),
|
||||||
|
path("<int:question_id>/results/", views.results, name="results"),
|
||||||
|
path("<int:question_id>/vote/", views.vote, name="vote")
|
||||||
]
|
]
|
|
@ -1,4 +1,15 @@
|
||||||
from django.http import HttpResponse
|
from django.http import HttpResponse
|
||||||
|
|
||||||
def index(request):
|
def index(request):
|
||||||
return HttpResponse("hello from within the poll index!")
|
return HttpResponse("hello from within the poll index!")
|
||||||
|
|
||||||
|
def detail(request, question_id):
|
||||||
|
return HttpResponse("you are looking at question %s." % question_id)
|
||||||
|
|
||||||
|
def results(request, question_id):
|
||||||
|
response = "you are looking at results for question %s"
|
||||||
|
return HttpResponse(response % question_id)
|
||||||
|
|
||||||
|
def vote(request, question_id):
|
||||||
|
return HttpResponse("you are voting on question %s" % question_id)
|
||||||
|
|
Loading…
Reference in New Issue