wkhtmltopdf (pdfkit) Could not connect to any X display
问题 I am trying to use wkhtmltopdf with Django ,nginx,uwsgi it works perfectly on development env running using manage.py runserver but when serving with nginx ans uwsgi i get this error: wkhtmltopdf exited with non-zero code 1. error: QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-isp' qt.qpa.screen: QXcbConnection: Could not connect to display Could not connect to any X display. Exception Location: /home/isp/Env/isp/lib/python3.6/site-package/pdfkit/pdfkit.py in to_pdf,