title: Django - How can I display a photo saved in ImageField?
body: <p>I've been going around in circles for hours with this.<br>
  I have a UserProfile model with <strong>profile_pic</strong> ImageField. I saved the user photo and now I want to display it, but nothing works. I went through docs, SO, google, with no result.<br>
  I uploaded a photo, and I can see that the url was saved in the database.
  This is what I have:  </p>
  
  <pre><code># models.py
      class UserProfile(models.Model):
          ...
          title       = models.CharField()
          about_me    = models.CharField()
          profile_pic = models.ImageField(upload_to=content_file_name, blank=True)
  
  # views.py
      def user_details(request):
          if request.method == 'POST':
              form = UserProfileForm(request.POST, request.FILES, instance=request.user.get_profile())
              if form.is_valid():
                  form.save()
                  return HttpResponseRedirect('/')
          else:
              form = UserProfileForm(instance=request.user.get_profile())
          return render_to_response('user_details.html',
                  {'user': request.user, 'form': form},
                  context_instance=RequestContext(request))
  
  # user_details.html
      {% for field in form %}
        {% if field.name != "profile_pic" %}
          &lt;!-- display regular fields --&gt;
          {{ field.label_tag }}{{ field }}
        {% else %}
          &lt;!-- display the user photo --&gt;
          &lt;img src="{{ MEDIA_URL }}{{ field.url }}" /&gt;
        {% endif %}
      {% endfor %}
  </code></pre>
  
  <p>When I view the source of the rendered HTML, all I see is the MEDIA_URL (ie 'media/') but not the photo url. If I replace {{ field.url }} with {{ field }} I get the url with the label "Currently", a "Clear" checkbox and an option to change image. But I cannot see the image itself.<br>
  Can anyone suggest what am I doing wrong?</p>