title: how to get username from login form, when reset password link is clicked django
body: <p>I am trying to get the username from my login form when the reset password link has been pressed.</p>
  
  <p>view.py </p>
  
  <p>def ResetPassword(request):</p>
  
  <pre><code>if request.method == 'POST':
      username = request.Post.get['login_username']
      if username:
          #send password reset link via email 
      else:
          #if username is empty search for your account 
          return render(request, 'accounts/forms/email_search.html',{})
  </code></pre>
  
  <p>forms.html </p>
  
  <pre><code> &lt;form class="navbar-form navbar" method="POST"action="{% url 'login' %}"&gt;
          {% csrf_token %}
  
          &lt;div class="form-group"&gt;
             {{ form.login_username }}
          &lt;/div&gt;
          &lt;div class="form-group"&gt;
             {{ form.login_password }}
          &lt;/div&gt;
          &lt;button type="submit" id="loginBtn" class="btn btn-default"&gt;Submit&lt;/button&gt;
          &lt;br&gt;
         &lt;a href="{% url 'ResetPassword' %}"&gt;Reset Password&lt;/a&gt;
        &lt;/form&gt;
  </code></pre>