I could use some help complying with Django\'s CSRF protection mechanism via my AJAX post. I\'ve followed the directions here:
http://docs.djangoproject.com/en/dev/r
Using Django 3.1.1 and all solutions I tried failed. However, adding the "csrfmiddlewaretoken" key to my POST body worked. Here's the call I made:
$.post(url, { csrfmiddlewaretoken: window.CSRF_TOKEN, method: "POST", data: JSON.stringify(data), dataType: 'JSON', });
And in the HTML template: