Search code examples
pythondjangodjango-registrationdjango-mailer

How do I make the built-in password_reset view use django-mailer?


I'm using django-registration on my web app. I also already use django-mailer to send a few notification emails.

Django registration enables the builtin password reset feature (here), by delegating the resetting logic to django.contrib.auth.views.password_reset.

Now that function doesn't know about django-mailer. How can I make it use django-mailer? Do I have to replicate the password_reset code?


Solution

  • Ahhh that was easy.

    I just had to set

    EMAIL_BACKEND = 'mailer.backend.DbBackend'
    

    in the settings file, like this

    Now, "normal" send_mail calls will behave like mailer.send_mail and store the email to the database. So there's no need to replace the calls themselves.