Javascript – Django 'none' values from ajax
My views: def deleteDepartement(request): object_id = request.POST.get('Id') name= request.POST.get('name') print(object_id) print(name) try: D=Department.objects.get(id=object_id) except: print("NOT FOUND") return redirect('department') JavaScript code: $.ajax({ type: 'POST', url: "{% url 'deleteDepartement' %}", data: { csrfmiddlewaretoken: '{{ csrf_token }}', Id:objectId, name:'test', }, }); I got…