Hi,
I am using the django to handle the file upload.
In the view implementation, I am trying to write the uploaded file to disk, but it causes bad performance because writing the uploaded file to disk spend lots of time.
Is any better solution to handle the file upload? Maybe create a detach thread to handle the file writing
The below is the simplified view implementation:
```
def upload_file(request):
if request.method == 'POST':
form = UploadFileForm(request.POST, request.FILES)
if form.is_valid():
with open('some/file/name.txt', 'wb+') as destination:
for chunk in f.chunks():
destination.write(chunk)
return HttpResponseRedirect('/success/url/')
else:
form = UploadFileForm()
return render(request, 'upload.html', {'form': form})
```