在我的模板中,我已经完成了:
<img src="{{MEDIA_URL}}{{file.media_file}}"
当我检查emlement时,我得到了
<img width="100" height="100" src="/media/sta.jpg"></img>
sta.jpt文件位于我的媒体文件夹中,但它显示could not load image
这里有什么问题?
答案 0 :(得分:0)
尝试将'django.template.context_processors.media'添加到TEMPLATES的'context_processors'选项中。 https://docs.djangoproject.com/en/1.8/ref/settings/#media-url