def send_tarball(tarball):
 wrapper = FileWrapper(tarball)
 response = HttpResponse(wrapper, content_type='application/x-tgz')
 response['Content-Disposition'] = ('attachment; filename=%s' % os.path.basename(tarball.name.encode('utf-8')))
 response['Content-Length'] = os.path.getsize(tarball.name)
 return response

def send_tarball ( tarball ) : wrapper = FileWrapper ( tarball ) response = HttpResponse ( wrapper , content_type = 'application/x-tgz' ) response [ 'Content-Disposition' ] = ( 'attachment; filename=%s' % os . path . basename ( tarball . name . encode ( 'utf-8' ) ) ) response [ 'Content-Length' ] = os . path . getsize ( tarball . name ) return response
renders a tarball to response .