title: Upload Image with Django Model Form
body: <p>I'm having difficulty uploading the following model with model form. I can upload fine in the admin but that's not all that useful for a project that limits admin access. </p>
  
  <pre><code>#Models.py
  class Profile(models.Model):
      name = models.CharField(max_length=128)
      user = models.ForeignKey(User)
      profile_pic = models.ImageField(upload_to='img/profile/%Y/%m/')
  
  #views.py
  def create_profile(request):
      try: 
          profile = Profile.objects.get(user=request.user)
      except:
          pass
      form = CreateProfileForm(request.POST or None, instance=profile)
  
      if form.is_valid():
         new = form.save(commit=False)
         new.user = request.user
         new.save()
  
  return render_to_response('profile.html', locals(), context_instance=RequestContext(request))
  
  
  #Profile.html
  &lt;form enctype="multipart/form-data" method="post"&gt;{% csrf_token %}
  &lt;tr&gt;&lt;td&gt;{{ form.as_p }}&lt;/td&gt;&lt;/tr&gt;
  &lt;tr&gt;&lt;td&gt;&lt;button type="submit" class="btn"&gt;Submit&lt;/button&gt;&lt;/td&gt;&lt;/tr&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>Note: All the other data in the form saves perfectly well, the photo does not upload at all. Thank you for your help!</p>