title: Django - serving user uploaded images
body: <p>I am having some problems with serving user uploaded files from my Django application:</p>
  
  <p>from models.py:</p>
  
  <pre><code>class Picture (models.Model):
  
      title = models.CharField(max_length=48)
  
      date_added = models.DateTimeField(auto_now=True)
  
      content = models.ImageField(upload_to='pictures')
  </code></pre>
  
  <p>From the Django admin the files get uploaded to the user_res/pictures/ folder.</p>
  
  <p>from the project's settings.py: </p>
  
  <pre><code>MEDIA_ROOT = 'user_res'
  
  MEDIA_URL = '/user_res/'
  
  STATIC_ROOT = ''
  
  STATIC_URL = '/static/'
  </code></pre>
  
  <p>Every time I try to reference a static resource (namely css or js files), everything works fine using URLs such as </p>
  
  <pre><code>http://localhost:8000/static/&lt;subfolder&gt;/main.css.
  </code></pre>
  
  <p>However, I cannot access user uploaded files (which get created by the admin interface in the user_res/pictures folder with a relative URL such as </p>
  
  <pre><code>user_res/pictures/test.jpg
  </code></pre>
  
  <p>the URL is dynamically created with this line of code from a Django Picture model callable:</p>
  
  <pre><code>return '&lt;img src="{}"/&gt;'.format(self.content.url)
  </code></pre>
  
  <p>I have no dedicated url-s for either static or media files in the url.py file.</p>
  
  <p>Does anybody have any idea as to how to make Django serve the media files? I understand that for live environments I will need to configure an http server to serve that particular directory, but for now I want to maintain a lightweight development suite. </p>
  
  <p>Thank you.</p>