title: Get the click event from a button in a django view
body: <p>i think the title is pretty clear. I want to know when the user clicks the button to run a piece of code in a function in my views.py. lets say i have this html: </p>
  
  <pre><code>&lt;div&gt;
      &lt;input type="button" name="_mail" value="Enviar Mail"&gt;  
  &lt;/div&gt;
  </code></pre>
  
  <p>and i want to run this code if the user clicks on it:</p>
  
  <pre><code>send_templated_mail(template_name='receipt',
                      from_email='robot@server.com',
                      recipient_list=[request.user.email],
                      context=extra_context)
  </code></pre>
  
  <p>that´s all i want to do.</p>
  
  <p><strong>EDIT</strong>: this is the view that i have:</p>
  
  <pre><code>def verFactura(request, id_factura):
      fact = Factura.objects.get(pk = id_factura)
      cliente = Cliente.objects.get(factura = fact)
      template = 'verfacturas.html'
      iva = fact.importe_sin_iva * 0.21
      total = fact.importe_sin_iva + iva
  
      extra_context = dict()
      extra_context['fact'] = fact
      extra_context['cliente'] = cliente
      extra_context['iva'] = iva
      extra_context['total'] = total
  
  
      if  (here i want to catch the click event):
          send_templated_mail(template_name='receipt',
                      from_email='imiguel@exisoft.com.ar',
                      recipient_list =['ignacio.miguel.a@gmail.com'],
                      context=extra_context)
  
          return HttpResponseRedirect('../facturas')
  
  
  
  return render(request,template, extra_context)
  </code></pre>