1
Add csrf_exempt
decorator to move_card
function or add csrfmiddlewaretoken
to ajax request data.
take a look this: https://docs.djangoproject.com/en/dev/ref/contrib/csrf/
example code:
add csrf_exempt to function
from django.views.decorators.csrf import csrf_exempt
@csrf_exempt
def move_card(request):
response_data = {'success': 'True'}
return HttpResponse(json.dumps(response_data ), content_type="application/json")
add csrfmiddlewaretoken to post data
check this: https://docs.djangoproject.com/en/dev/ref/contrib/csrf/#ajax
Source:stackexchange.com