Форма Django Password не загружается
Page not found (404)
Request Method: GET
Request URL: http://127.0.0.1:8000/5/password/
Using the URLconf defined in My_Blog_Project.urls, Django tried these URL patterns, in this order:
admin/
account/
blog/
\[name='index'\]
The current path, 5/password/, didn’t match any of these.
You’re seeing this error because you have DEBUG = True in your Django settings file. Change that to False, and Django will display a standard 404 page.
views.py
@login_required
def pass_change(request):
current_user = request.user
change = False
form = PasswordChangeForm(current_user)
if request.method == "POST":
form = PasswordChangeForm(current_user, data=request.POST)
if form.is_valid():
form.save()
change = True
return render(
request,
"App_Login/pass_change.html",
context={"form": form, "change": change},
)
pass_change.html
{% extends 'base.html' %}
{% load crispy_forms_tags %}
{% crispy form %}
{% block title_block %}
Change Password
{% endblock %}
{% block body_block %}
{% if change %}
Password changed successfully.
{% endif %}
{% csrf_token %}
{{ form|crispy }}
Change Password
{% endblock %}
шаблонurl для моего приложения App_login
path('password/',views.pass_change, name='pass_change')
main urls.py
from django.contrib import admin
from django.urls import path, include
from . import views
urlpatterns = [
path("admin/", admin.site.urls),
path("account/", include("App_Login.urls")),
path("blog/", include("App_Blog.urls")),
path("", views.Index, name="index"),
]
Как я могу решить эту проблему?