1
인쇄용 PDF 기능을 구현했습니다. 나는 피라미드, wkhtmltopdf 및 jinja2을 사용하여 pdf를 생성합니다. gunicorn에서 잘 작동합니다. 그러나 프로덕션 환경에 배포 할 때 (프로덕션 환경에서 실행하려면 circud을 사용합니다.) 오류 메시지없이 함수가 실패합니다. 소스 코드는 다음과 같다 :서커스에서 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를 의미하며, 그렇다면 백엔드는 무엇입니까? Circus는 WSGI 서버가 아니며 전송할 수있는 응답 유형에 영향을 미치지 않아야합니다. –