Sorl-thumbnail bugs 502 with large image

≡放荡痞女 提交于 2019-12-09 04:09:25

My friend helped me with this problem. The Pil bugs!

There is a thing like Engine in Sorl-Thumbnail. Default is Pil

'sorl.thumbnail.engines.pil_engine.Engine' 

and it bugs with large images. So it is better to use something another like

Pgmagick, ImageMagick / GraphicsMagick or Wand

We chosed ImageMagick. In settings.py add

THUMBNAIL_ENGINE = 'sorl.thumbnail.engines.convert_engine.Engine'

and install it by

apt-get install imagemagick

And possibly it will be necessary to increate time for image resize processing in gunicorn by this command

--timeout 600

Also possibly server just does not have enough RAM. I used a server with 512 mb RAM. With simple site. (no wasting RAM...)

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