首页 > 解决方案 > 在easy_thumbnail django中使用图片URL

问题描述

目前我在我的 django 模板中使用以下代码来显示图片并相应地裁剪:

<img src= "{% thumbnail obj.picture 375x550 box=obj.cropping crop detail %}" alt="">

相反,我想使用 obj.picture.url 而不是图片对象本身。无论如何使用django的easy_thumbnails来做到这一点。我不想使用其他方式,因为我已经在整个应用程序中使用了裁剪功能设置。

标签: djangodjango-templateseasy-thumbnails

解决方案


推荐阅读