this is the code in my models file:
from django.db import models
class Studio(models.Model):
.....
.....
metroimage = models.ImageField(upload_to='images', blank=True)
this is the code on the template file:
{% for place in studio %}
.....
.....
<img class="metro" src="{{ place.metroimage.url }}"><b>{{ place.metro }}</b><br>
{% endif %}
but when the page displays i get this (this is source-code)
.....
.....
<img class="metro" src="/http://momo.webfactional.com/media/images/m3.png"><b>Zara</b><br>
what's with the forward slash before http? i can't get the uploaded image to display...
我想您的MEDIA_URL设置(在settings.py中)应归咎于多余的斜线。
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.