Failed to reverse my URL

I want to reverse my URL in a template, the spelling is right but it cannot find a valid pattern name. Is there anything missed before I use this function?
Here is the error message:


Here is my code in urls.py

from django.urls import path
from . import views
app_name = 'vote'
urlpatterns = [
    path('', views.index, name='index'),
    path('page/', views.page, name='page'),
]

Hi.

This bit:

Are you using include in a main urls.py elsewhere? If so the url would be vote:page. (See the URL namespaces docs)

1 Like

Yes, the problem is solved, thanks a lot.