title: How do i send email to user to reset password without explicitly filling PasswordResetForm?
body: <p>I am making a Django web app using 1.11.2 version in which admin is registering users using default django authentication views and customized html templates.I want that when admin clicks on 'Register' and submits the details (like username,email,password and confirmed password) an email is simultaneously sent to user's email-id in which there is a link to reset password so that user can reset his/her password.I don't want to explicitly use password_reset_view and password_reset_done view unless i am using forgot password option.</p>
  
  <p>Here what i have coded.</p>
  
  <p>views.py</p>
  
  <pre><code> from django.contrib.auth import get_user_model
   from django.contrib.auth.mixins import LoginRequiredMixin
   from django.contrib.auth.models import Permission, User
   from django.contrib.auth.views import RegisterView
  
   class RegisterView(SuccessMessageMixin, CreateView):
     form_class = RegisterForm
     template_name = 'registration/register.html'
     success_message = "Your account was created successfully."
  
     def dispatch(self, *args, **kwargs):
       return super(RegisterView, self).dispatch(*args, **kwargs)
  </code></pre>
  
  <p>register.html</p>
  
  <pre><code>{% extends "base.html" %}
  {% block nav_people %}
  class="active"
  {% endblock %}
  {% block content %}
  {% load static %}
  &lt;!DOCTYPE html&gt;
  &lt;html lang=en&gt;
  &lt;head&gt;
    &lt;link rel="stylesheet" href="{% static "dashboard/css/login.css" %}"/&gt;
   &lt;/head&gt;
      &lt;body&gt;
       &lt;title&gt;Register&lt;/title&gt;
        &lt;div class="reg"&gt;
        &lt;div class="regbox"&gt;
  
          &lt;h1&gt;Register&lt;/h1&gt;
          &lt;br&gt;
  
       &lt;form class='text-left' method="post" action="{% url 'register' %}"&gt;
        {% csrf_token %}
        {{ form.as_p }}
  
       &lt;input type="submit" value="Register" /&gt;
       &lt;input type="hidden" name="next" value="{{ next }}" /&gt;
      &lt;/form&gt;
  
      &lt;/div&gt;
     &lt;/div&gt;
     &lt;/body&gt;
    &lt;/html&gt;
    {% endblock %}
  </code></pre>
  
  <p>forms.py</p>
  
  <pre><code>class RegisterForm(forms.ModelForm):
    """A form for creating new users. Includes all the required
    fields, plus a repeated password."""
    password1 = forms.CharField(label='Password', widget=forms.PasswordInput)
    password2 = forms.CharField(label='Password confirmation', 
    widget=forms.PasswordInput)
  
    class Meta:
      model = User
      fields = ('username', 'email',)
  
    def clean_email(self):
      email = self.cleaned_data.get("email")
      qs = User.objects.filter(email__iexact=email)
      if qs.exists():
          raise forms.ValidationError("Cannot use this email. It's already 
          registered")
      return email
  
     def clean_password2(self):
      # Check that the two password entries match
       password1 = self.cleaned_data.get("password1")
       password2 = self.cleaned_data.get("password2")
       if password1 and password2 and password1 != password2:
          raise forms.ValidationError("Passwords don't match")
      return password2
  
     def save(self, commit=True):
      # Save the provided password in hashed format
       user = super(RegisterForm, self).save(commit=False)
       user.set_password(self.cleaned_data["password1"])
       #user.password = "asdfasd"
       user.is_active = True
  
  
        if commit:
          user.save()
          # user.profile.send_activation_email()
          # create a new user hash for activating email.
         return user
  </code></pre>
  
  <p>login.html</p>
  
  <pre><code>{% load static %}
   &lt;!DOCTYPE html&gt;
  &lt;html lang=en&gt;
  &lt;head&gt;
  
  &lt;title&gt;Login&lt;/title&gt;
  &lt;link rel="stylesheet" href="{% static "dashboard/css/login.css" %}"/&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;div class="login"&gt;
  &lt;div class="loginbox"&gt;
  {% if form.errors %}
  &lt;p&gt;Your username and password didn't match. Please try again.&lt;/p&gt;
  {% endif %}
  
  {% if next %}
  {% if user.is_authenticated %}
  &lt;p&gt; To proceed,
  please login with an account that has access.&lt;/p&gt;
  {% else %}
  
  
      {% if not form.errors %}
      &lt;p&gt;Please login to see this page.&lt;/p&gt;
      {% endif %}
  
   {% endif %}
   {% endif %}
  
   &lt;form method="post" action="{% url 'login' %}"&gt;
   {% csrf_token %}
  
   &lt;label&gt;USER NAME &lt;/label&gt;{{ form.username }}&lt;br&gt;
   &lt;label&gt;PASSWORD &lt;/label&gt;{{ form.password }}&lt;br&gt;
  &lt;input type="submit" value="Login" /&gt;
   &lt;input type="hidden" name="next" value="{{ next }}" /&gt;
   &lt;/form&gt;  
   &lt;a href='{% url "reset_password" %}' class="btn"&gt;Forgot Password&lt;/a&gt;
  &lt;/div&gt;
  &lt;/div&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>