S
S
Sergey Nizhny Novgorod2016-01-23 06:59:33
Django
Sergey Nizhny Novgorod, 2016-01-23 06:59:33

What is the correct way to use PasswordResetForm in Django?

Hello.
I would like to clarify with experienced developers how to properly recover a password in Django.
My implementation:
1) Add to settings.py:

EMAIL_USE_TLS = True
EMAIL_HOST = 'smtp.yandex.ru'
EMAIL_PORT = 25
EMAIL_HOST_USER = '[email protected]'
EMAIL_HOST_PASSWORD = 'W123456'
DEFAULT_FROM_EMAIL = '[email protected]'
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'

2) Add to url.py #Inherits
url('^', include('django.contrib.auth.urls'))url from django.
3) Create a registration subfolder in the Templates folder of the project (not the application, but in the project folder itself), create 4 templates:
password_reset_form.html
password_reset_done.html
password_reset_confirm.html
password_reset_complete.html

In these files we insert what django sets by default ( garmoncheg.blogspot.com.au/2012/07/django-resettin... and rewrite and customize everything as we need it.
It seems to me that this is some bicycle way Are there more practical and convenient ways to customize these shapes?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dmitry Kalinin, 2016-01-23
@Terras

You can customize simply from forms.py if the current page suits you. But for templates, the option is very convenient if you use it in the settings TEMPLATE_DIRS(since 1.8 TEMPLATES). When redesigning a project or customizing files, this method will save you a lot of time.

S
sim3x, 2016-01-23
@sim3x

It seems to me that this is some kind of bicycle way.
that's just how it seems

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question