1
votes

On our django based site only the admin can create new user but he can not set any password and i have used email_new_user function. So on new user creation an email is sent with password reset link.

this is how my function in models.py look like :-

    def email_new_user(sender, **kwargs):
        print kwargs
        if kwargs["created"]:
        new_user = kwargs["instance"]
        send_mail('Set Your Password', 'http://127.0.0.1:8000/accounts/password/reset/', 'from_email',[new_user.email], fail_silently=False)
    post_save.connect(email_new_user, sender=User)

but i want to know what do i need to write on the place of SEND_EMAIL() function so that i can directly send the password_reset_confirm_email to the newly created user on the place of sending him this url where he can enter his email address in order to get the password reset confirm email.

1
I am using the django-registration-1.0 app.btechhb

1 Answers

-1
votes

You can setup a custom action for the admin: https://docs.djangoproject.com/en/1.7/ref/contrib/admin/actions/

Or have you looking into packages that provide registration/email reset options: I use this one: https://docs.djangoproject.com/en/1.7/ref/contrib/admin/actions/