django-rest-framework - 尝试从 django 数据库显示图像时的消息:“znet”属性没有与之关联的文件
问题描述
znet 是存储我们图像的地方
from .models import Contactus
def contact(request):
cont = Contactus.objects.all()
context={'cont':cont}
return render(request,'contactus.html',context)
{% for cont in cont %}
<div class=" flex-item-right ">
<div class="thisweekabout"><img src="{{cont.znet.url}}" style="height: 100%; width: 100%;" alt="">
</div>
</div>
<hr>
{% endfor %}
解决方案
推荐阅读
- python - 针对特定列的数据格式化 python csv
- android - 在运行时为没有对话框的android私有应用授予READ_EXTERNAL_STORAGE权限
- python - KeyError:“['Date'] 在轴中找不到”?
- html - 如何删除父表格单元格和内部表格之间的空间
- lisp - lisp:获取初始列表并将其与其他列表进行比较的函数
- javascript - Javascript 在第一次点击后停止工作
- python - Python数据框中布尔值的滚动计数
- java - 在列中显示不带文本的图像
- amazon-web-services - 我可以从云网站故障转移到 AWS 的本地吗?
- javascript - 如何在javascript中点击更改css?