[Django]-Django/Python convert PDF using shell (os.system/Popen) not working in production

1👍

mod_wsgi when spawned from the apache2 process won’t have the $PATH defined that you have on your shell, so you should pass subprocess.Popen the absolute pathname for the libreoffice binary, i.e. /usr/bin/libreoffice, not just its filename.

0👍

You could import the LibreOffice / OpenOffice uno module to Python and and avoid using the command line. I’ve been writing up some more complete documentation, which you can download at http://documenthacker.wordpress.com/ (or maybe soon www.documenthacker.com).

There is an example in the cookbook section for converting a document to PDF.

Leave a comment