1👍
✅
Why are you saving it to the model class directly? Try:
form = User_ImageForm(request.POST, request.FILES)
if form.is_valid():
im = form.save()
HttpResponseRedirect("/accounts/profile")
👤CJ4
0👍
You don’t need to following lines.
im = User_Image(request.POST, request.FILES)
im = im.save()
Enough to save the form,
.....
if form.is_valid():
form.save()
HttpResponseRedirect("/accounts/profile")
.....
- [Answer]-Django admin/frontend authentication issue
- [Answer]-HttpResponse content type for csv and other extentions doesn't work in firefox but works in Chrome and IE
Source:stackexchange.com