def get(request, version, build_number, path): build = CommCareBuild.get_build(version, build_number) file = build.fetch_file(path) response = HttpResponse(file) response['Content-Disposition'] = "attachment; filename=%s" % path.split("/")[-1] return response
def get(request, version, build_number, path): build = CommCareBuild.get_build(version, build_number) try: file = build.fetch_file(path) except ResourceNotFound: raise Http404() response = HttpResponse(file) response['Content-Disposition'] = "attachment; filename=%s" % path.split("/")[-1] return response