Текущий путь, accounts/login/, не соответствует ни одному из этих путей
Я пытался реализовать процесс сброса пароля в django, но что-то не работает, я знаю из ошибки, что есть шаблон url, который не выходит, но откуда пришли учетные записи/логин, раньше все работало нормально, но мой коллега взял мой ноутбук и после этого произошло это
urls.py
"""travel URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/2.0/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-based views
1. Add an import: from other_app.views import Home
2. Add a URL to urlpatterns: path('', Home.as_view(), name='home')
Including another URLconf
1. Import the include() function: from django.urls import include, path
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
"""
from django.contrib import admin
from django.urls import path,include
from django.contrib.auth import views as auth_views
urlpatterns = [
path('admin/', admin.site.urls),
path('',include('loginpage.urls')),
path('signup/',include('signup.urls')),
path('homepage/',include('Homepage.urls')),
path('password_reset/',auth_views.PasswordResetView.as_view(template_name='loginpage/resetpassword.html'),name='password_reset'),
path('password_reset_sent/',auth_views.PasswordResetDoneView.as_view(template_name='loginpage/password_resent_sent.html'),name='password_reset_done'),
path('reset/<uidb64>/<token>/',auth_views.PasswordResetConfirmView.as_view(template_name='loginpage/password_reset_form.html'),name='password_reset_confirm'),
path('Password_changed_succesfully/',auth_views.PasswordResetConfirmView.as_view(template_name='loginpage/password_reset_done.html'),name='password_reset_complete')
]
resetpassword.html:
<!DOCTYPE html>
<html>
<head>
{% load static %}
<title>Reset Password</title>
<link rel="stylesheet" type="text/css" href="{% static 'reset.css' %}">
<link href="https://fonts.googleapis.com/css2?family=Jost:wght@500&display=swap" rel="stylesheet">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.3.0/font/bootstrap-icons.css" />
</head>
<body>
<div class="right"><img src="{% static 'images/logo2.png' %}" height="400" width="400"></div>
<div class="main">
<input type="checkbox" id="chk" aria-hidden="true">
<div class="resett">
<form method="post">
{% csrf_token %}
{{form}}
<input type='submit' name=" Send email">
</form>
</div>
</div>>
</body>
</html>
password_reset_form.html
<h3>Password reset sent</h3>
<p>We’ve emailed you instructions for setting your password, if an account exists with the email you entered. You should receive them shortly.</p>
<p>If you don’t receive an email, please make sure you’ve entered the address you registered with, and check your spam folder.</p>
password_reset_done.html:
<h3>Password reset complete</h3>
<p>Your password has been set. You may go ahead and log in now.</p>
<a href="{% url loginpage:check_user %}">Log in</a>
Ошибка:
Page not found (404)
Request Method: GET
Request URL: http://127.0.0.1:8000/accounts/login/?next=/Password_changed_succesfully/
Using the URLconf defined in travel.urls, Django tried these URL patterns, in this order:
admin/
[name='check_user']
signup/
homepage/
password_reset/ [name='password_reset']
password_reset_sent/ [name='password_reset_done']
reset/<uidb64>/<token>/ [name='password_reset_confirm']
Password_changed_succesfully/ [name='password_reset_complete']
The current path, accounts/login/, 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.