Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/329.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python sorl缩略图可以';我不展示这幅画_Python_Django_Sorl Thumbnail - Fatal编程技术网

Python sorl缩略图可以';我不展示这幅画

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

更新:我通过添加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.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 %}