You are sending the data through the request body (body:JSON.stringify({'productId':productId,'action':action})
), which means you have to access it in views.py
:
data = json.loads(request.body)
Also, you can always check the attributes of an object with the dir
built-in.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…