i am using Django Build in
PasswordResetView class.
i am using Django File backend
in settings. i tried to reset password of an existing account and django returns a success but still no email is sent.
Here is code for reference:
settings.py
EMAIL_BACKEND = 'django.core.mail.backends.filebased.EmailBackend'
EMAIL_FILE_PATH = os.path.join(BASE_DIR,'sent_emails')
views.py
class MyPasswordReset(PasswordResetView):
email_template_name = 'email/forgot_password.html'
form_class = ForgotPassword
from_email = '[email protected]'
success_url = reverse_lazy('users:password_reset_done')
form.py
class ForgotPassword(PasswordResetForm):
email = forms.EmailField(widget=forms.EmailInput(attrs=
{'class': 'form-control', 'title': 'Enter Email', 'placeholder': 'Email'}),
max_length=50, label=False, required=True,
)
Password Reset Email Template
email/forgot_password.html
you forgot your password!! Sample Email
Code for Complete reference: https://github.com/deepak1725/basicCrud/tree/dk-signup/users
file backend
. Expected behavior is make *.log files in my foldersent_emails
with email content in it. – Deepak Sharma