urls.py
from django.conf.urls import url
from . import views
urlpatterns = [
url(\'\', views.index, name= \'index\'),
url(\'add\', views.addTodo, name =\'add\')
Well you wrote a path like:
url('complete//', views.completeTodo, name='complete'),
But here
is part of the url, it does not denote a variable, etc. it means that there is only one url that will match: /complete/
.
In case you use django-2.x, you probably want to use path(..)
instead:
path('complete/', views.completeTodo, name='complete'),
Furthermore in case todo_id
is typically an integer, it is advisable to specify the type:
path('complete/<int:todo_id>', views.completeTodo, name='complete'),
For django-1.x, you can not use such path(..)
s, and in that case you need to write a regular expression, like:
url(r'^complete/(?P[0-9]+)$', views.completeTodo, name='complete'),