Errno 13 Permission denied in django-wkhtmltopdf

纵饮孤独 提交于 2020-01-15 06:42:07

问题


I use django-wkhtmltopdf to generate PDF documents. I described a clear path to the django-wkhtmltopdf.

WKHTMLTOPDF_CMD = '/home/vagrant/envs/vagrant/lib/python2.7/site-packages/wkhtmltopdf'

I get the error:

[Errno 13] Permission denied

Permissions in the path to the django-wkhtmltopdf:

drwxrwxr-x 3 vagrant vagrant Feb 17, 4096 7:32 wkhtmltopdf

回答1:


You need to install wkhtmltopdf itself, and specify the path to the binary (either in /usr/bin or /usr/local/bin).




回答2:


What worked for me was:

  1. Download the file from oficial page
  2. From the file you downloaded extract the /bin/wkhtmltopdf file
  3. Place it somewhere at your project
  4. In settings.py specify the FULL path to the binary file like:

    WKHTMLTOPDF_CMD = '/home/stefanos/vEnvs/assembla/lib/python2.7/site-packages/wkhtmltopdf/wkhtmltopdf'



来源:https://stackoverflow.com/questions/28580691/errno-13-permission-denied-in-django-wkhtmltopdf

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!