1
我已经完成了打印pdf功能。我使用金字塔,wkhtmltopdf和jinja2生成pdf。它工作正常gunicorn。但是,当我将其部署到生产环境时(我使用马尔可夫在生产环境中运行)时,该函数将失败,并且不会显示任何错误消息。源代码如下:无法回复马戏团中的pdf文件
pdf_renderer = PDFRenderer()
request = self.request
html = render('test.jinja2' , pdf_data, request)
response = request.response
response.write(pdf_renderer(html))
response.content_type = 'application/pdf'
response.headerlist.append(('Content-Disposition', 'attachment; filename='test.pdf'))
#Everything is ok except the final statement.
#circusd cannot run the statement "return response"
#However, gunicorn can do it
return response
那么,您对我的问题有什么建议或想法吗?它是如此直接,我不明白为什么它工作正常gunicorn但circusd
通过'circusd'你是指chaussette,如果是的话,后端是什么?马戏团不是WSGI服务器,应该对可发送的响应类型没有影响。 – 2013-05-03 08:20:44