浮游生物-wkhtmltoppdf rest服务
plankton的Python项目详细描述
#浮游生物-html到pdf rest服务
使用wkhtmltoppdf作为后端。 仅适用于Python3.5或更高版本。
催眠者: https://github.com/openlabs/docker-wkhtmltopdf和https://github.com/incuna/django-wkhtmltopdf。
##安装 一。`pip install plankton` 2.下载并安装wkhtmltoppdf http://wkhtmltopdf.org/downloads.html。 三。运行服务器``浮游生物服务器``
如果要在Docker容器中运行:
- 克隆回购`git clone git@github.com:django-stars/plankton.git`
- `cd plankton`
- 构建docker映像`docker build -t plankton .`
- 运行容器`docker run -p 9003:8080 plankton`。
您可以指定wkhtmltoppdf命令和端口: `plankton-server--wkhtmltopdf_command '/usr/local/bin/wkhtmltopdf' --port 9000`
##用法
后`http://127.0.0.1:9003/html-to-pdf/`
数据`{"page":"http://google.com.ua"}`
您可以提供wkhtmltoppdf选项:
数据`{"page":"http://google.com.ua", "options": {"javascript-delay": 2000, "cookie": [["key1","val1"], ["key2", "val2"]]}}`
##待办事项 项目正在开发中,有很多事情要做:
- 调试模式
- http选项
- 日志记录
- 安全性
- …