https://github.com/roman-yatsenko/django-topics/tree/main/news
python manage.py runserver
# http://127.0.0.1:8000/users/password_change/
touch templates/registration/password_change_form.html
touch templates/registration/password_change_done.html
templates\registration\password_change_form.html
{% extends 'base.html' %}
{% block title %}Password Change{% endblock %}
{% block content %}
<h1>Password change</h1>
<p>Please enter your old password, for security's sake, and then enter your new password twice so we can verify you typed it in correctly.</p>
<form method="POST">
{% csrf_token %}
{{ form.as_p }}
<input class="btn btn-success" type="submit" value="Change my password">
</form>
{% endblock %}
python manage.py runserver
templates\registration\password_change_done.html
{% extends 'base.html' %}
{% block title %}Password Change Successful{% endblock %}
{% block content %}
<h1>Password change successful</h1>
<p>Your password was changed.</p>
{% endblock content %}
news_project\settings.py
EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
python manage.py runserver
# http://127.0.0.1:8000/users/password_reset/
touch templates/registration/password_reset_form.html
touch templates/registration/password_reset_done.html
touch templates/registration/password_reset_confirm.html
touch templates/registration/password_reset_complete.html
templates\registration\password_reset_form.html
{% extends 'base.html' %}
{% block title %}Forgot Your Password?{% endblock %}
{% block content %}
<h1>Forgot your password?</h1>
<p>Enter your email address below, and we'll email instructions for setting a new one.</p>
<form method="POST">
{% csrf_token %}
{{ form.as_p }}
<input class="btn btn-success" type="submit" value="Send me instructions!">
</form>
{% endblock %}
templates\registration\password_reset_done.html
{% extends 'base.html' %}
{% block title %}Email Sent{% endblock %}
{% block content %}
<h1>Check your inbox.</h1>
<p>We've emailed you instructions for setting your password. You should receive the email shortly!</p>
{% endblock %}
python manage.py runserver
# http://127.0.0.1:8000/users/password_reset/
templates\registration\password_reset_confirm.html
{% extends 'base.html' %}
{% block title %}Enter new password{% endblock %}
{% block content %}
<h1>Set a new password!</h1>
<form method="POST">
{% csrf_token %}
{{ form.as_p }}
<input class="btn btn-success" type="submit" value="Change my password">
</form>
{% endblock %}
templates\registration\password_reset_complete.html
{% extends 'base.html' %}
{% block title %}Password reset complete{% endblock %}
{% block content %}
<h1>Password reset complete</h1>
<p>
Your new password has been set. You can log in now on the <a href="{% url 'login' %}">log in page</a>.
</p>
{% endblock %}
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_HOST = 'smtp.sendgrid.net'
EMAIL_HOST_USER = 'sendgrid_username'
EMAIL_HOST_PASSWORD = 'sendgrid_password'
EMAIL_PORT = 587
EMAIL_USE_TLS = True
© Яценко Р.Н., 2021
Учебный центр компьютерных технологий "Кит"
© Яценко Р.М., 2018-2025
Apr 26, 2025(c) Яценко Р.М., 2018-2025
Apr 19, 2025© Яценко Р.М., 2019-2023
Apr 19, 2025Тема 4<br>Електронний ринок (c) Яценко Р.М., 2010-2022 Презентація https://bit.ly/2ZrBCQs Зміст Інтернет-магазини
Apr 7, 2025or
By clicking below, you agree to our terms of service.
New to HackMD? Sign up