在django视图中生成的文件,下载此附件后,我需要重定向到其他URL。
请有人建议我如何实现此方法或任何其他方法来下载文件附件,而在django视图中不返回响应
def some view(request):
with fs.open("filename.pdf") as pdf:
response = HttpResponse(pdf, content_type='application/pdf')
response['Content-Disposition'] = "attachment; filename=filename.pdf"
return response
# Here I want to redirect to other page