使用HttpRequest作为django-celery task时报错
我在用django-celery时尝试把httprequest作为参数调用task,结果保用一下错误,求解哪里粗错了?
add_scan_record.delay(request, card.id)
File "/Users/user/qrcardenv/lib/python2.7/site-packages/celery/app/task.py", line 358, in delay
return self.apply_async(args, kwargs)
File "/Users/user/qrcardenv/lib/python2.7/site-packages/celery/app/task.py", line 474, in apply_async
**options)
File "/Users/user/qrcardenv/lib/python2.7/site-packages/celery/app/amqp.py", line 249, in publish_task
**kwargs
File "/Users/user/qrcardenv/lib/python2.7/site-packages/kombu/messaging.py", line 157, in publish
compression, headers)
File "/Users/user/qrcardenv/lib/python2.7/site-packages/kombu/messaging.py", line 233, in _prepare
body) = encode(body, serializer=serializer)
File "/Users/user/qrcardenv/lib/python2.7/site-packages/kombu/serialization.py", line 170, in encode
payload = encoder(data)
File "/Users/user/qrcardenv/lib/python2.7/site-packages/kombu/serialization.py", line 356, in dumps
return dumper(obj, protocol=pickle_protocol)
PicklingError: Can't pickle <type 'cStringIO.StringO'>: attribute lookup cStringIO.StringO failed
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论