title: How to get an ImageField URL within a template?
body: <p>I've got the following model in my Django app:</p>
  
  <pre><code>class Image(models.Model):
      image = models.ImageField(
          upload_to='images/', 
          height_field='height', 
          width_field='width'
      )
      credit = models.CharField(max_length=50, blank=True)
      caption = models.TextField(blank=True)
      article = models.ForeignKey(Article)
      width = models.PositiveIntegerField(
          blank = True, null = True,
          editable = False,
          default = 0
      )
      height = models.PositiveIntegerField(
          blank = True, null = True,
          editable = False,
          default = 0
      )
  </code></pre>
  
  <p>I've set the MEDIA_ROOT to a directory called /hmedia/ inside my Apache web root, and I've set MEDIA_URL to <code>'http://localhost/hmedia/'</code>. This seems to have worked – I've successfully uploaded a couple of images through the Django admin site, and I can view those images via <code>http://localhost/hmedia/images/[filename]</code>. And the Django admin site actually shows me the filename, and links to the live URL for each image, and the links work.</p>
  
  <p>My problem is, I can't work out how to get the URLs or filenames of these images in my template:</p>
  
  <pre><code>&lt;ul&gt;
  {% for image in article.image_set.all %}
      &lt;li&gt;Caption: "{{image.caption}}", Credit: "{{image.credit}}", URL: "{{image.url}}"&lt;/li&gt;
  {% endfor %}
  &lt;/ul&gt;
  </code></pre>
  
  <p>The above template results in this output:</p>
  
  <pre><code>&lt;ul&gt;
  
      &lt;li&gt;Caption: "here's an image caption", Credit: "some photographer", URL: ""&lt;/li&gt;
  
      &lt;li&gt;Caption: "Another caption here", Credit: "Another photographer", URL: ""&lt;/li&gt;
  
  &lt;/ul&gt;
  </code></pre>
  
  <p>In other words, it correctly outputs the caption and credit properties of each image, but it outputs nothing for {{image.url}}.</p>
  
  <p>How do I get the image's URL in my template? How does the Django admin interface template do it? (I've rooted around in the admin templates directory but can't find what I'm looking for.)</p>