1👍
✅
The data you are sending is simply a json string.
You have to parse that string before you can access data within it. For this you can use Python’s json module (it should be available if you’re using Python 2.7).
import json
data = json.loads( request.POST.get('id') )
id = data["id"]
If you somehow don’t have the json module, you can get the simplejson module.
For more details, refer this question : best way to deal with JSON in django
0👍
That’s happening because id
is string, not dict as it should be. Please provide your template and view code to find source of problem.
- [Answer]-Keep older value of a dom element
- [Answer]-Form not being loaded into template
- [Answer]-Django fandjango migration 4.2
- [Answer]-How can I add user `first_name` in this queryset? (this is incorrect)
Source:stackexchange.com