iis 上跑就报 OSError: [WinError 6] 句柄无效。跪求大佬看看
資深大佬 : rationa1cuzz 8
我在终端手动启动项目 python manage.py runserver 没问题
代码如下
import imgkit
path_wkimg = r’C:Program Fileswkhtmltopdfbinwkhtmltoimage.exe’ # 工具路径
cfg = imgkit.config(wkhtmltoimage=path_wkimg)
options = {“encoding”: “UTF-8”} # 这个具体要看你那个 html 页面到底是以什么编码格式保存的
if not prefix:
prefix = str(uuid.uuid4())
img_file_path = r’d:xx.png’
imgkit.from_string(html_str, img_file_path, config=cfg, options=options)
代码如下
import imgkit
path_wkimg = r’C:Program Fileswkhtmltopdfbinwkhtmltoimage.exe’ # 工具路径
cfg = imgkit.config(wkhtmltoimage=path_wkimg)
options = {“encoding”: “UTF-8”} # 这个具体要看你那个 html 页面到底是以什么编码格式保存的
if not prefix:
prefix = str(uuid.uuid4())
img_file_path = r’d:xx.png’
imgkit.from_string(html_str, img_file_path, config=cfg, options=options)
大佬有話說 (1)