本文介绍了django芹菜 - 如何发送request.FILES ['照片']到任务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试通过以下方式发送request.FILES ['photo'],一个上传的文件到tCelery:
i'm trying to send request.FILES['photo'], an uploaded file from my site, to tCelery via:
tasks.upload_photos.delay(img=request.FILES['photo'])I得到一个pickle错误,因为它不能序列化它。发送文件到任务的方式是什么?
I get a pickle error because it cannot serialize it. What is the way to send a file to task?
错误:无法打开StringO对象谢谢。
error: "can't pickle StringO objects" thanks.
推荐答案将文件内容读入字符串,然后用dict中的内容类型打包,然后发送。
Read the file contents into a string, then pack it with the content type in a dict and send that.
更多推荐
django芹菜
发布评论