一滩海豹 2022-01-17 16:50 采纳率: 53.8%
浏览 40
已结题

django内FileResponse报unable to get repr 问题是什么原因

FileResponse里出现
unable to get repr for <class 'django.http.response.FileResponse'>问题该怎么解决

        if ready:
            filename = task.result
            return FileResponse(open(filename, mode='rb'), as_attachment=True)

img

img

  • 写回答

1条回答 默认 最新

  • ~白+黑 新星创作者: python技术领域 2022-01-19 09:32
    关注

    建议看下django的官方文档上传文件部分

    评论

报告相同问题?

问题事件

  • 已结题 (查看结题原因) 4月8日
  • 创建了问题 1月17日