I have the following button: <a class="btn btn-success">Accept</a>
. Like this previous stack overflow question, I want to call my view after the button is clicked, but I can not seem to get it to work.
What I have tried: Using AJAX, treating button like a form, requesting post data, but this does not seem to work.
How can I make it so when my button is clicked, I call the bellow view?
def acceptdonation(request, pk):
Donation.objects.filter(pk=pk).update(views=F('views')+1)
return HttpResponseRedirect(request.GET.get('next')))