0👍
✅
As Klaus D. said in comment this was a problem with encoding.
When I changed
if encoding is not None:
response['Content-Encoding'] = encoding
to
response['Content-Encoding'] = 'tar'
Everything stated to working properly.
1👍
If you need to serve a tar.gz file do this,
tar = tarfile.open("file_name.tar.gz", "r")
response = HttpResponse(tar, content_type='application/tar+gzip')
response['Content-Disposition'] = 'attachment; filename="file_name.tar.gz"'
return response
- ImportError: No module named django.core.wsgi when deploying with nginx
- TemplateSyntaxError in Django
- Remapping traffic from one port to another using ATS
Source:stackexchange.com