from django.core.files import File f = File(open(os.path.join(IMPORT_DIR, 'fotos', photo), 'rb')) p = Photo(name=f.name, image=f, parent=supply.supply_ptr) name = str(uuid1()) + os.path.splitext(f.name)[1] p.image.save(name, f) p.save()