Django2.1-错误-一切正常,但开始出现{%ur'name'%} l错误

时间:2018-09-14 01:39:43

标签: django python-3.x

enter image description here enter image description here

一切正常,但是当我删除时,它开始提示{%ur'name'%} l错误!使用django-2.1,jinja2,python-3.6

1 个答案:

答案 0 :(得分:0)

urlpatterns = [
    path('accounts', views.accounts,name='accounts'),
    path('friends',views.friends,name='friends'),
    path('about',views.about,name='about'),
    path('photo',views.photo,name='photo'),
    path('video',views.video,name='video'),
    path('favpage',views.favpage,name='favpage'),
    path('accountsetting', views.accountsetting, name='accountsetting'),
    path('personalinfo', views.personalinfo, name='personalinfo'),
    path('favpagecreate', views.favpagecreate, name='favpagecreate'),
    path('friendgroup', views.friendgroup,name='friendgroup'),
    path('Hobbies', views.Hobbies, name='Hobbies'),
    path('notification', views.notification,'notification'), # this one
    path('Education', views.Education, name='Education'),
    path('changepass', views.changepass, name='changepass'),
    path('chatmessage', views.chatmessage, name='chatmessage'),
    path('friendrequest', views.friendrequest, name='friendrequest'),
]

正如我在评论中提到的那样,您缺少name=部分,因此它将其作为kwargs值,该值用于将关键字参数放入视图函数中。如果您修复了该部分,错误应该会消失。