title: Delete function in Django not working
body: <p>I am trying to create a delete function for my Workout model.
  This is the model:</p>
  
  <pre><code>class Workout(models.Model):
      workoutID = models.AutoField(primary_key=True)
      name = models.CharField(max_length=40)
      created_by = models.ForeignKey(User)
      description = models.TextField()   
      created_at = models.DateTimeField(auto_now_add=True)
  
      def delete(self):
          return reverse("delete_workout", kwargs = {'workout_id': self.workoutID})
  </code></pre>
  
  <p>Next I have the view:</p>
  
  <pre><code>def delete_workout(request, workout_id):
      workout = get_object_or_404(Workout, workoutID = workout_id)
      print(workout)
      if request.user != workout.created_by:
          return HttpResponse('Not ur workout')
      else:
          workout.delete()
          return HttpResponseRedirect('/')
  </code></pre>
  
  <p>This is the url:</p>
  
  <pre><code>url(r'^(?P&lt;workout_id&gt;\d+)/delete/$', views.delete_workout, name='delete_workout'),  
  </code></pre>
  
  <p>And finally the html:</p>
  
  <pre><code>&lt;a href='{{ instance.delete }}'&gt;
      &lt;button&gt;Delete Workout&lt;/button&gt; 
  &lt;/a&gt;
  </code></pre>
  
  <p>I'm not getting any errors in the console, which is why I don't know what is going wrong.</p>