26👍
✅
There might be something missing like request.FILES in views.py or enctype=”multipart/form-data” in the form.
Look here: https://docs.djangoproject.com/en/1.8/topics/http/file-uploads/
or see this : https://godjango.com/35-upload-files/
- Celery does not registering tasks
- Perform a logical exclusive OR on a Django Q object
- Get a queryset's current order_by ordering
- Django REST Framework and generic relations
- Pip install Django on python3.6
2👍
I don’t know why it’s not working but in my project, which works, I’m getting the image from the post request like so:
profile_form = ProfileForm(data=request.POST)
if profile_form.is_valid():
if 'picture' in request.FILES:
current_user.image = request.FILES['image']
- Django 1.8: Migrations not detected after deleting migrations folder
- Django models and Python properties
- Django-rest-framework : list parameters in URL
- Docker Django could not connect to server: Connection refused
Source:stackexchange.com