Using mod_wsgi for my Flask application. When generating a PDF file from the application, I am sending the stream back to the client. My Problem is the pdf is not being sent back to the client but ending up (in a text format) in the apache error.logs. How can I fix this? I am sending the response with the correct headers (or so I thought):
response.headers.set('Content-Type', 'application/pdf')
response.headers.set('Content-Disposition', 'attachment', filename='ledger.pdf')
This works in development using python's internal server.