Add password change page

This commit is contained in:
Sokurov Idar 2021-04-26 21:47:45 +03:00
parent 1bb951dcda
commit 5c3801c317
4 changed files with 29 additions and 2 deletions

View File

@ -14,6 +14,7 @@ Including another URLconf
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
"""
from django.contrib import admin
from django.contrib.auth import views
from django.urls import path, include
from main.views import main_page, profile_page, CustomRegistrationView, CustomLoginView, registration_error
@ -36,8 +37,7 @@ urlpatterns = [
path('accounts/', include('django_registration.backends.activation.urls')),
path('control/', AdminPageView.as_view(), name='control'),
path('statistic/', statistic_page, name='statistic'),
]
]
# Django REST
urlpatterns += [

View File

@ -31,6 +31,7 @@
alt="Нет изображения"
>
</div>
<a href="{%url 'password_change' %}">Сменить пароль</a>
</div>
<div class="col">
<h5><span class="badge bg-secondary text-light">Имя пользователя</span> {{ profile.name }}</h5>

View File

@ -0,0 +1,12 @@
{% extends "base/base.html" %}
{% load static %}
{% block title %}Пароль успешно изменен{% endblock title %}
{% block heading %}Пароль успешно изменен{% endblock %}
{% block content %}
<div>
<h4>Ваш пароль был изменен.</h4>
</div>
{% endblock content %}

View File

@ -0,0 +1,14 @@
{% extends "base/base.html" %}
{% load static %}
{% block title %}Изменение пароля{% endblock title %}
{% block heading %}Сменить пароль{% endblock %}
{% block content %}
<form method="post">
{% csrf_token %}
{{ form.as_p }}
<input type="submit" value="Сменить" class="btn btn-success">
</form>
{% endblock content %}