我有一个项目,其中使用django-wkhtmltopdf生成文档。 似乎一切正常,但当我点击下载文档时,我收到错误:
OSError at /users/doc-in-pdf/51/
[Errno 2] No such file or directory
Request Method: GET
Request URL: http://localhost:8080/users/doc-in-pdf/51/
Django Version: 1.5.4
Exception Type: OSError
Exception Value:
[Errno 2] No such file or directory
Exception Location: /usr/lib/python2.7/subprocess.py in _execute_child, line 1249
Python Executable: /home/vagrant/envs/vagrant/bin/python
Python Version: 2.7.3
在控制台中,我收到以下地址:
[18/Feb/2015 07:41:14] "GET /users/doc-in-pdf/51/ HTTP/1.1" 500 93487
答案 0 :(得分:2)
尝试将此添加到您的settings.py
WKHTMLTOPDF_CMD = '/usr/local/bin/wkhtmltopdf'