title: Create a popup for confirming delete action using django-popup-view-field
body: <p>I'm trying to create a popup for confirming delete action using django-popup-view-field. I have been following an example given in <a href="https://pydigger.com/pypi/django-popup-view-field" rel="nofollow noreferrer">https://pydigger.com/pypi/django-popup-view-field</a>. The challenge I face is for me to pass a primary key for the user I want to delete when I click on the delete button in he drivers_list.html. Here's my code:`</p>
  
  <p><strong>drivers_list.html</strong></p>
  
  <pre><code>{% for driver in object_list %}
     &lt;tr&gt;
         &lt;td&gt;{{ driver.first_name }} &lt;/td&gt;
         &lt;td&gt;{{ driver.last_name }}&lt;/td&gt;
         &lt;td&gt;{{ driver.licence_category }}&lt;/td&gt;
         &lt;td&gt;{{ driver.phone }}&lt;/td&gt;
         &lt;td&gt;{{ driver.email }}&lt;/td&gt;
         &lt;td&gt;{{ driver.status }}&lt;/td&gt;
         &lt;td align="center"&gt;
             &lt;a href="{% url 'view_driver' pk=driver.id %}"&gt;&lt;button class="btn btn-success btn-sm"&gt;View&lt;/button&gt;&lt;/a&gt;
             &lt;a href="{% url 'edit_driver' pk=driver.id %}"&gt;&lt;button class="btn btn-primary btn-sm"&gt;Edit&lt;/button&gt;&lt;/a&gt;
             &lt;a href="{% url "django_popup_view_field:get_popup_view" 'delete_driver' pk=driver.id %}"&gt;&lt;button class="btn btn-danger btn-sm"&gt;Delete&lt;/button&gt;&lt;/a&gt;
         &lt;/td&gt;
     &lt;/tr&gt;
  {% endfor %}
  </code></pre>
  
  <p>**driver_confirm_delete.html<code>**</code></p>
  
  <pre><code>&lt;h4&gt;&lt;span class="label label-warning"&gt;Are you sure you want to delete {{ driver.first_name }} {{ driver.last_name }}?&lt;/span&gt;&lt;/h4&gt;
  &lt;div class="row"&gt;
      &lt;div class="col-md-4"&gt;
          &lt;form action="{{ target }}" method='POST'&gt;
              {% csrf_token %}
              &lt;h4&gt;&lt;span class="label label-warning"&gt;NOTE:This action cannot be reversed!&lt;/span&gt;&lt;/h4&gt;
              &lt;ul&gt;
                  {{ form.as_ul }}
              &lt;/ul&gt;
              &lt;input type="submit" class="btn btn-danger btn-md" value="Confirm delete"/&gt;
              &lt;a href="{% url 'drivers_list' %}"&gt;&lt;button type="button" class="btn btn-info btn-md"&gt;Cancel&lt;/button&gt;&lt;/a&gt;
         &lt;/form&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p><strong>urls.py</strong></p>
  
  <pre><code>urlpatterns = [
  url(r'^delete_driver/(?P&lt;pk&gt;\d+)/$', d_views.DeleteDriverView.as_view(), name='delete_driver'),
  url(r'^django_popup_view_field/', include('django_popup_view_field.urls', namespace="django_popup_view_field")),]
  </code></pre>
  
  <p>views.py</p>
  
  <pre><code>class DeleteDriverView(FormMessagesMixin, DeleteView):
  
      model = Driver
      template_name = 'drivers/driver_confirm_delete.html'
      success_url = reverse_lazy('drivers_list')
      form_valid_message = 'Driver was deleted successfully!'
  </code></pre>