1👍
✅
Try using a django file instead of just an open file.
from django.core.files import File
...
f = open(FILENAME,'r')
A=XML()
A.xml.save(filename, File(f), save=True)
A.save()
Source:stackexchange.com