views:

29

answers:

1

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"&gt;&lt;b&gt;Zara&lt;/b&gt;&lt;br&gt;

what's with the forward slash before http? i can't get the uploaded image to display...

A: 

I'd guess your MEDIA_URL settings (in settings.py) is to blame for the extra slash.

Guillaume Esquevin