title: Django view bypass render request
body: <p>I have a table with data and a button in which the user can delete the whole object, I implemented a template where the user is supposed to be redirected so he can choose between confirm the delete or cancel it.</p>
  <p>But when I click the delete button it instantly delete the object, any idea on how to tell the view to first go to that template and then, if it's the case, delete the object?</p>
  <p>Here is the <strong>template</strong>: <code>borrar_oficio.html</code> I want to be redirected after clicking the delete button:</p>
  <pre><code>{% extends 'base.html' %}
  
  {% block content %}
  
  &lt;p&gt;Are you sure you want to delete {{ item }}?&lt;/p&gt;
  
  &lt;form action=&quot;{% url 'oficios:borrar' item.id %}&quot; method=&quot;POST&quot;&gt;
      {% csrf_token %}
  
      &lt;a href=&quot;{% url 'oficios:list' %}&quot;&gt;Cancelar&lt;/a&gt;
  
      &lt;input type=&quot;submit&quot; name=&quot;Confirmar&quot;&gt;
  &lt;/form&gt;
  
  {% endblock content %}
  </code></pre>
  <p>Here is the piece of the <strong>template</strong> where the button is:</p>
  <pre><code> &lt;form action=&quot;{% url 'oficios:borrar' oficio.folio  %}&quot; method='POST'&gt;
   {% csrf_token %}
   &lt;button type=&quot;submit&quot; class=&quot;btn btn-danger btn-lg&quot; data-toggle=&quot;tooltip&quot; data-placement=&quot;top&quot; title=&quot;Eliminar&quot;&gt;&lt;i class=&quot;fas fa-trash-alt&quot;&gt;&lt;/i&gt;&lt;/button&gt;
   &lt;/form&gt;  
  </code></pre>
  <p>Here is the method that deletes the object in <code>views.py</code></p>
  <pre><code>@login_required(login_url=&quot;/accounts/login/&quot;)
  def borrar_oficio(request, pk):
      oficio = Oficio.objects.get(folio=pk)
      if request.method == &quot;POST&quot;:
          oficio.delete()
          return redirect('oficios:list')
      context = {'item': oficio}
      return render(request, &quot;borrar_oficio.html&quot;, context)
  </code></pre>
  <p>And my <code>urls.py</code> of that app:</p>
  <pre><code>app_name = 'oficios'
  
  urlpatterns = [
      path('', views.lista_oficios, name=&quot;list&quot;),
      path('crear/', views.crear_oficio, name=&quot;crear&quot;),
      path('editar_oficio/&lt;str:pk&gt;', views.editar_oficio, name=&quot;editar&quot;),
      path('borrar_oficio/&lt;str:pk&gt;', views.borrar_oficio, name=&quot;borrar&quot;),
      path('dependencia/', views.agregar_dependencia, name=&quot;dependencia&quot;),
  ]
  </code></pre>