[Django]-How to manually assign imagefield in Django

20👍

See the django docs for django.core.files.File

Where fd is an open file object:

model_instance.image_field.save('filename.jpeg', fd.read(), True)
👤null

Leave a comment