I am trying to pass parameters using Ajax and Django 1.11 and getting the error Not Found: /enquiry/followup_alter/.Here is the code.
Error:
Not Found: /enquiry/followup_alter/
Ajax:
$(document).ready(function () {
$(".remove").click(function () {
$(this).parents('tr').hide();
var a_href = $(this).attr('href');
$.ajax({
type:"GET",
url:"/enquiry/followup_alter/",
data:"id=" +a_href,
success: function (response) {
alert(response)
}
});
});
})
enquiry/urls.py:
url(r'^followup_alter/id=(?P<id>[\d]+)/$', views.followup_alter),
views.py:
def followup_alter(request,id):
get = Followup.objects.get(id = id)
get.status = 1
get.save()
return HttpResponse('Entry Removed')
Please help!