Django:Photologue不会在模板中显示图像

anh*_*ran 1 django django-templates photologue

我正在尝试安装django-photologue.一切似乎都没问题,因为我按照官方指南进行安装和设置.我必须上传一些照片作为例子.但是,在查看照片或图库详细信息时,会出现如下错误:

Caught an exception while rendering: 'Photo' object has no attribute 'get_thumbnail_url'
Run Code Online (Sandbox Code Playgroud)

我尝试从文件photo_detail.html中删除以下代码

{% if object.public_galleries %}
<h2>This photo is found in the following galleries:</h2>
<ol>
{% for gallery in object.public_galleries %}
    <li>{%previous_in_gallery object gallery%} <a href="{{ gallery.get_absolute_url }}">{{ gallery.title }}</a> {%next_in_gallery object gallery%}</li>
{% endfor %}
</ol>
{% endif %}
Run Code Online (Sandbox Code Playgroud)

没有更多错误,但图片没有出现.如果点击链接仍然会导致正确的照片看到.我认为问题在于:

{{ object.get_display_url }}
Run Code Online (Sandbox Code Playgroud)

完全没有回报任何价值.请帮我解决这个问题.谢谢!

Jus*_*oll 6

您是否python manage.py plinit在安装后运行并选择同时创建a thumbnaildisplayphotosize?需要在数据库中定义这些照片.