2👍
Change the imports to:
from django.conf.urls import url
from django.views.generic import TemplateView
from . import views
Change your urlpatterns
to:
urlpatterns = [
url(r'^(?P<election_id>\d+)/$', views.vote),
url(r'^(?P<election_id>\d+)/ok/$', TemplateView.as_view(template = "election/vote-ok.html")),
url(r'^(?P<election_id>\d+)/results/$', views.results),
url(r'^(?P<election_id>\d+)/mailing/$', views.mailing),
]
👤pp_
Source:stackexchange.com