You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
from django.urls import path
|
|
|
|
|
|
|
|
from . import views
|
|
|
|
|
|
|
|
app_name = 'polls'
|
|
|
|
# urlpatterns = [
|
|
|
|
# path('', views.index, name='index'),
|
|
|
|
# path('<int:question_id>/', views.detail, name='detail'),
|
|
|
|
# path('<int:question_id>/results/', views.result, name='result'),
|
|
|
|
# path('<int:question_id>/vote/', views.vote, name='vote')
|
|
|
|
#
|
|
|
|
# ]
|
|
|
|
|
|
|
|
# 通用视图
|
|
|
|
urlpatterns = [
|
|
|
|
path('', views.IndexView.as_view(), name='index'),
|
|
|
|
path('<int:pk>/', views.DetailView.as_view(), name='detail'),
|
|
|
|
path('<int:pk>/results/', views.ResultView.as_view(), name='result'),
|
|
|
|
path('<int:question_id>/vote/', views.vote, name='vote')
|
|
|
|
|
|
|
|
]
|