2👍
✅
I expect that img attribute is FileField. right?
user.userprofile.img = request.POST.get('uploaded_image', False)
please try this.
user.userprofile.img = request.FILES.get('uploaded_image')
# if you have multiple files to upload
user.userprofile.img = request.FILES.getlist('uploaded_image')
Source:stackexchange.com