我正在尝试在Django中实现更改当前用户密码的功能。但是无论我用什么,我总是会遇到这个everse for 'index' not found. 'index' is not a valid view function or pattern name
错误和一个显示这些代码行的模板。
Error during template rendering
In template /home/squad-minds/PycharmProjects/squad-services/Admin_interface/venv/lib/python3.7/site-packages/django/contrib/admin/templates/admin/base.html, error at line 3
1 {% load i18n static %}<!DOCTYPE html>
2 {% get_current_language as LANGUAGE_CODE %}{% get_current_language_bidi as LANGUAGE_BIDI %}
3 <html lang="{{ LANGUAGE_CODE|default:"en-us" }}" {% if LANGUAGE_BIDI %}dir="rtl"{% endif %}>
4 <head>
其中}" {% if LANGUAGE_BIDI
为红色。我已经使用CBV实现了这一点
from django.contrib.auth.views import PasswordChangeView
from django.contrib.auth.forms import PasswordChangeForm
class PasswordChange(UserPassesTestMixin, PasswordChangeView):
form_class = PasswordChangeForm
success_url = '/'
def test_func(self):
return self.request.user.is_superuser
path('password/change', views.PasswordChange.as_view(), name='change_password'),
这是什么索引索引,为什么我要得到它?