I'm trying to send a big file (more than 2.7 GB) with axios to Django:
const formData = new FormData()
formData.append('myFile', myFile)
const config = {...}
axios.post(url, formData, config)...
Now, it sends all the data, but the memory usage starts growing even before the view starts!
def my_view(request: HttpRequest) -> HttpResponse:
print('Starts the view')
...
If the file is small the message prints correctly, now with the huge file the server crashes due to memory usage before the print
is reached. I've tried to change the upload handler to only use disk in settings.py
:
FILE_UPLOAD_HANDLERS = ['django.core.files.uploadhandler.TemporaryFileUploadHandler']
But had the same result. I don't know whats happening, I can't even try this solution as nothing of the view's code is executed. What I'm missing? Any kind of help would be really appreciated
Update:
I've made a question in Django official forum where more information is available about solution and problems about this
question from:
https://stackoverflow.com/questions/65907005/django-crash-when-upload-a-big-file 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…