app_name = "myadmin"
urlpatterns = [
url(r'^change-password/$', auth_views.password_change,
{ 'template_name': 'myadmin/password_change', 'current_app': 'myadmin', },
name='password_reset'
),
url(r'^password-change-done/$', auth_views.password_change_done,
{'current_app': 'myadmin'},
name='password_change_done'
),
]
当我访问127.0.01:8001/myadmin/change-password
时,会引发以下错误:
<{>NoReverseMatch
/myadmin/change-password/
反向 带有参数'()'和关键字参数'{}'的'password_change_done'
未找到。尝试了0种模式:[]
正如您所看到的,我已将app_name
传递给password_change()
视图,但它未到达视图内部。
答案 0 :(得分:0)