📅  最后修改于: 2022-03-11 14:46:40.704000             🧑  作者: Mango
from django.core.files.uploadedfile import SimpleUploadedFile
newPhoto.image = SimpleUploadedFile(name='test_image.jpg', content=open(image_path, 'rb').read(), content_type='image/jpeg')