[Answered ]-Django: 'WSGIRequest' object has no attribute 'PUT'

2👍

try this

from django.http import QueryDict
qd = QueryDict(request.body)
put_dict = {k: v[0] if len(v)==1 else v for k, v in qd.lists()}

.
now you can directly update an object by **put_dict

OR

one liner

put_dict = {k: v[0] if len(v)==1 else v for k, v in QueryDict(request.body).lists()}

Leave a comment