Is there any ways to save a binary data get from an external url (in my case, an excel file) into a Django FileField, with the file uploaded to the destination according to the django project settings?
class FileData(models.Model):
excel_file = models.FileField(upload_to='excel_file_path')
import requests
url = 'https://www.example.getfile.com/file_id=234'
r = requests.get(url)
# How to store the binary data response to FileField?
Thanks for help. Please also let me know if further information is needed in my case.