import requests from django.core.files import File from django.core.files.temp import NamedTemporaryFile def save_image_from_url(model, url): r = requests.get(url) img_temp = NamedTemporaryFile(delete=True) img_temp.write(r.content) img_temp.flush() model.image.save("image.jpg", File(img_temp), save=True)