title: Django rest framework - Delete model objects from HTML
body: <p>So i'm developing an app using Django framework, and i need HTML forms to insert/delete and update data from the database. I was able to make the form to Update the data, but i can't seem to find any info on how to make a Create form and a delete button. 
  I tried this, with no success:</p>
  
  <p><strong>HTML</strong></p>
  
  <pre><code>&lt;form action="{% url 'conta_details_html' conta.id %}" data-method="delete"&gt;
  
      &lt;input type="submit" value="delete"&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>Views:</p>
  
  <pre><code>class ContaDetailsHTML(APIView):
      renderer_classes = [TemplateHTMLRenderer]
      template_name = 'conta_details.html'
  
      def get(self, request, pk):
          user = request.user
          conta = get_object_or_404(Conta, pk=pk,user=user)
          serializer = ContaDetailsSerializerHTML(conta)
          return Response({'serializer': serializer, 'conta': conta})
  
      def delete(self,request,pk):
          """Deletes a transaccao"""
          user = request.user
          if not user.is_authenticated:
              return Response(status=status.HTTP_403_FORBIDDEN)
          conta = get_object_or_404(Conta, pk=pk, user=user)
          serializer = ContaDetailsSerializerHTML(conta,many=False)
          if conta:
              conta.delete()
              return Response(status=status.HTTP_200_OK)
          return Response(serializer.errors,status=status.HTTP_400_BAD_REQUEST)
  </code></pre>
  
  <p>Maybe im not getting the syntax correct on the html, but the update form was pretty easy, like this:</p>
  
  <pre><code>&lt;form action="{% url 'conta_details_html' conta.id %}" method="POST"&gt;
      {% csrf_token %}
      {% render_form serializer %}
      &lt;input type="submit" value="Save"&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>any idea ? </p>
  
  <p>Edit:</p>
  
  <p><strong>URL:</strong></p>
  
  <pre><code>url(r'^api/html/contas/(?P&lt;pk&gt;[0-9]+)/$', views.ContaDetailsHTML.as_view(), name='conta_details_html'),
  </code></pre>