django easy-thumbnail not working, pillow isn't causing it

安稳与你 提交于 2019-12-12 04:20:02

问题


I'm not sure why it's not working

settings file

THUMBNAIL_DEBUG = True
THUMBNAIL_ALIASES = {
    'image': {
        'standard': {
            'size': (70, 70),
            'crop': True,
        }
    }
}

Index.html I load thumbnail then

 <img src="{{ post.image|thumbnail_url:'standard' }}" alt=""/></img>

回答1:


I never used THUMBNAIL_ALIASES but this way always worked for me:

{% load thumbnail %}

{% thumbnail post.image as im %}
    <img src="{{ im.url }}">
{% endthumbnail %}

btw, your img tag is wrong.



来源:https://stackoverflow.com/questions/34521778/django-easy-thumbnail-not-working-pillow-isnt-causing-it

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