title: Simple Django Image Upload - Image file not saving
body: <p>Right I'm learning how to do a simple image upload form to upload an image to MEDIA_ROOT. The form renders fine, I get no errors, but the file is not showing up in the MEDIA_ROOT directory. If followed the documentation example and can't get it to work and I know it is because I have not understood django file upload handeling properly. So here is my code:</p>
  
  <p>forms.py</p>
  
  <pre><code>from django import forms
  
  class UploadImageForm(forms.Form):
      image = forms.ImageField()
  </code></pre>
  
  <p>views.py</p>
  
  <pre><code>def merchant_image_upload(request):
      if request.method == 'POST':
          form = UploadImageForm(request.POST, request.FILES)
          if form.is_valid():
              FileUploadHandler(request.FILES['image'])
              return HttpResponseRedirect('/dashboard/gallery')
      else:
          form = UploadImageForm()
      return render_to_response('gallery.html', RequestContext(request, {'form': form}))
  </code></pre>
  
  <p>template file</p>
  
  <pre><code>{% extends 'base.html' %}
  {% block main %}
      &lt;form action="{% url scvd.views.merchant_image_upload %}" method="post"&gt;{% csrf_token %}
          {{ form.image }}
          &lt;input type="submit" value="Upload" /&gt;
      &lt;/form&gt;
  {% endblock %}
  </code></pre>
  
  <p>Hopefully that's sufficient info to get some help. Please let me know what else I can provide. Thank you, I really appreciate the help.</p>