urls.py
from django.conf.urls import url
from . import views
urlpatterns = [
url(\'\', views.index, name= \'index\'),
url(\'add\', views.addTodo, name =\'add\')
I was facing the same issue, Here is the solution :
As your model name is Todo (Capital T) you are fetching the ID of each Tudo but in the views, URLs & template you are writing small (t). It becomes case sensitive.
Change the name (todo_id) to (Todo_id) everywhere in the views URLs and HTML template.
Here it is :
urls.py
url('complete/', views.completeTodo, name='complete'),
template.html
views.py
def completeTodo(request, Todo_id):
todo = Todo.objects.get(pk=Todo_id)