In my django App on the login page i want to have a request password button which functions like, when this button is clicked I get a request from the user per email to provide that user a password for the site.At the template login.html I made this change :
{% extends "base.html" %}
{% load url from future %}
{% block site_contents %}
{% if form.errors %}
<p>Your username and password didn't match. Please try again.</p>
{% endif %}
<form method="post" action="{% url 'django.contrib.auth.views.login' %}">
{% csrf_token %}
<table>
<tr>
<td>{{ form.username.label_tag }}</td>
<td>{{ form.username }}</td>
</tr>
<tr>
<td>{{ form.password.label_tag }}</td>
<td>{{ form.password }}</td>
</tr>
</table>
<input type="submit" name="request_password" value="Request Password" />
<input type="submit" value="login" />
<input type="hidden" name="next" value="{{ next }}" />
</form>
{% endblock %}
Where in views can I write code to capture the event request_password and write my code to email to the amdin about user's request?
Thanks in advance