urls.py
from django.conf.urls import url
from . import views
urlpatterns = [
url(\'\', views.index, name= \'index\'),
url(\'add\', views.addTodo, name =\'add\')
Your regex expression is wrong:
Instead of this:
url('complete/', views.completeTodo, name='complete'),
try this:
url(r'^complete/(?P\d+)$', views.completeTodo, name='complete'),
Or in case you want to use path
path('complete/', views.completeTodo, name='complete'),
EDIT
Since you're using Django 1.*, you can't use path()
The correct way to set up all your URLs is with url
regex expressions
Note
'^': The match must start at the beginning of the string or line.
'$': The match must occur at the end of the string
'\d+': Match all digits
The
r
at the beginning stands forregex
url(r'^$', views.index, name= 'index'),
url(r'^add$', views.addTodo, name ='add'),
url(r'^complete/(?P\d+)$', views.completeTodo, name='complete'),
url(r'^deletecomplete$', views.deleteCompleted, name='deletecomplete'),
url(r'^deleteall$', views.deleteAll, name='deleteall')