Python sorl缩略图可以';我不展示这幅画
更新:我通过添加URL解决了这个问题Python sorl缩略图可以';我不展示这幅画,python,django,sorl-thumbnail,Python,Django,Sorl Thumbnail,更新:我通过添加URL解决了这个问题 urlpatterns = patterns('', url(r'^media/(?P<path>.*)$', 'django.views.static.serve', {'document_root': settings.MEDIA_ROOT}),) 模板:menu.html {% load thumbnail %} {% thumbnail "https://www.google.com.tw/images/srpr/logo11w
urlpatterns = patterns('',
url(r'^media/(?P<path>.*)$', 'django.views.static.serve', {'document_root': settings.MEDIA_ROOT}),)
模板:menu.html
{% load thumbnail %}
{% thumbnail "https://www.google.com.tw/images/srpr/logo11w.png" "100x80" as im %}
<img src="{{ im.url }}" width="{{ im.width }}" height="{{ im.height }}">
{% endthumbnail %}
{%load缩略图%}
{%缩略图“https://www.google.com.tw/images/srpr/logo11w.png“100x80”作为im%}
{%endthumbnail%}
设置
DEBUG=True
查看它为什么不工作安装后您会执行syncb
吗?但是我的终端有一条消息lib/python2.7/site packages/sorl/thumbnail/helpers.py:5:DeprecationWarning:django.utils.simplejson不推荐使用;改用json。从django.utils import simplejson
我必须安装一些东西吗?不,你不必,这只是警告,没有什么不好的,你使用南方的吗?您是否进行了迁移
?
{% load thumbnail %}
{% thumbnail "https://www.google.com.tw/images/srpr/logo11w.png" "100x80" as im %}
<img src="{{ im.url }}" width="{{ im.width }}" height="{{ im.height }}">
{% endthumbnail %}