title: Django - Image from MEDIA_URL not showing up on template?
body: <p>So I have read a number of stack overflow answers on this matter but none of them can seem to solve my problem. I have setup a MEDIA_ROOT, MEDIA_URL, STATIC_ROOT, and STATIC_URL but for some reason images in my media_url are not showing up on my template while images from my static_url are. </p>
  
  <p>My code is below as well as a further explanation.</p>
  
  <p>Settings.py</p>
  
  <pre><code>STATICFILES_DIRS = (
      ('/static/',
      '/home/joe/Documents/exchange/Texchange/textchange/static',),
      ('/media/',
      '/home/joe/Documents/exchange/Texchange/textchange/media/',),
  )
  
  MEDIA_ROOT = '/home/joe/Documents/exchange/Texchange/textchange/media/'
  
  MEDIA_URL = '/media/'
  
  STATIC_ROOT = '/home/joe/Documents/exchange/Texchange/textchange/'
  
  STATIC_URL = '/static/'
  </code></pre>
  
  <p>Models.py</p>
  
  <pre><code>class Posting(models.Model):
      textbook = models.ForeignKey(Textbook)
      condition = models.CharField(max_length = 200)
      price = models.DecimalField(max_digits=5, decimal_places=2)
      user = models.ForeignKey(User)
      image = models.ImageField(upload_to='postingpics/%Y/%m/%d', default="../../static/textchange/nophoto.jpg")
      post_date = models.DateTimeField('date_posted')
  
      def __str__(self):
          return str(self.textbook)
  
      def was_posted_recently(self):
          return self.post_date &gt;= timezone.now() - datetime.timedelta(days=1)
      was_posted_recently.admin_order_field = 'post_date'
      was_posted_recently.boolean = True
      was_posted_recently.short_description = 'Posted recently'
  </code></pre>
  
  <p>Template.html</p>
  
  <pre><code>&lt;div class="row marketing"&gt;
        &lt;div class="col-lg-6"&gt;
          &lt;h3&gt;Textbook Info&lt;/h3&gt;
            &lt;p&gt;&lt;strong&gt;Textbook: &lt;/strong&gt;{{ posting.textbook.textbook_name }}&lt;/p&gt;
            &lt;p&gt;&lt;strong&gt;Condition: &lt;/strong&gt;{{ posting.condition }}&lt;/p&gt;
            &lt;p&gt;&lt;strong&gt;Price: &lt;/strong&gt;{{ posting.price }}&lt;/p&gt;
            &lt;p&gt;&lt;strong&gt;Class: &lt;/strong&gt;{{ posting.textbook.class_name }}&lt;/p&gt;
            &lt;p&gt;&lt;strong&gt;ISBN: &lt;/strong&gt;{{ posting.textbook.isbn }}&lt;/p&gt;
            &lt;p&gt;&lt;strong&gt;Author: &lt;/strong&gt;{{ posting.textbook.author }}&lt;/p&gt;
          &lt;h3&gt;Contact Info&lt;/h3&gt;
            &lt;p&gt;&lt;strong&gt;User: &lt;/strong&gt;{{ posting.user.username }}&lt;/p&gt;
            &lt;p&gt;Button to contact&lt;/p&gt;
  
  
        &lt;/div&gt;
  
        &lt;div class="col-lg-6"&gt;
          {% block content %}
            &lt;img src="{{ posting.image.url }}"&gt;
            &lt;p&gt;{{ posting.image.url }}&lt;/p&gt;
          {% endblock %}
        &lt;/div&gt;
      &lt;/div&gt;
  </code></pre>
  
  <p>So as you can see if I don't upload an image for a posting it goes to a default image which is stored in static/textchange. This image will show up on the template. If I do upload an image the image will not show up on the template. In my template.html I have the text {{ posting.image.url }} in paragraph tags to see what the url for the different images look like.</p>
  
  <p>When the default image in static/textchange is being used the url is: /../static/textchange/nophoto.jpg and the image shows up fine.</p>
  
  <p>When I try and display an uploaded image in to the template the url is: /media/postingpics/2015/09/20/Star-Wars-Sith-Code-Wallpaper-2_dlPszgQ.jpg and no image shows up...</p>
  
  <p>I find it weird how the static image has the /../ in front of static but I don't know why that's showing up just for the image from the static folder.</p>
  
  <p>Any help would be appreciated.</p>