[Django]-Django upgrade from 1.3 to 1.9 generate TypeError: Item in “from list'' not a string

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_

Leave a comment