2๐
โ
I found the part wich was wrong (Javascript):
Here is the new JavascriptPart (which works for me):
var arr = {};
arr["first"] = "first";
arr["second"] = "second";
arr["third"] = "third";
var success = ""
$.ajax({
type: "POST",
url: "/AJAX?modus=create",
data: {"data": JSON.stringify(arr)},
success: success,
dataType: "application/json",
headers: {"X-CSRFToken": getCookie('csrftoken')}
});
And this is the django-part (view):
def AJAX(request):
if request.method == 'POST':
method = request.REQUEST.get("modus","")
if method == 'create':
data = request.POST.get('data');
๐คLee
- [Answered ]-Django FileField in model maximum recursion depth exceeded while calling a Python object
Source:stackexchange.com