title: cannot change(edit) the file uploaded in django
body: <p>My project contain a profile for a person, in which they can upload their photo as profile picture. The problem is i cannot change this photo. In the edit section i can edit all other things like name,address etc.. but not the photo. </p>
  
  <p>my models.py is:</p>
  
  <pre><code>def get_upload_file_name(instance,filename):
      return "image/%s_%s"%(str(time()).replace('.','_'),filename)
  
  class Customer_Profile(models.Model):
      user = models.OneToOneField(User)
      first_name = models.CharField(_('First Name'), max_length= 30)
      middle_name = models.CharField(_('Middle Name'), max_length= 30,null = True,blank=True)
      last_name = models.CharField(_('Last Name'), max_length= 30)
      photo = models.ImageField(_('Photo'), upload_to=get_upload_file_name, null=True, blank=True,default='image/nophoto.png')
  </code></pre>
  
  <p>my forms.py is:</p>
  
  <pre><code>class Customer_Prof(forms.ModelForm):
      class Meta:
          model = Customer_Profile
          fields = ('photo','first_name','middle_name','last_name','address','phone_no')
  
  class update_company_prof(forms.ModelForm):
      class Meta:
          model = Company_Profile
          fields =    ('name','logo','address','phone_no','url','cat_software','cat_electronics','cat_ mechanical','cat_civil','cat_other','specialized_in','prev_projects')
  </code></pre>
  
  <p>my views.py is:</p>
  
  <pre><code>def edit_customer(request, offset):
      if request.method == 'POST':
          customer_edit = update_customer_prof(request.POST, instance=request.user.customer_profile)
          if customer_edit.is_valid():
              customer_edit.save()
              return HttpResponseRedirect('customer/' + offset)
      else:
          customer_edit =  update_customer_prof(instance=request.user.customer_profile)
      return render_to_response('edit_cust_prof.html', {'customer_edit':  customer_edit},
                                context_instance=RequestContext(request))
  </code></pre>
  
  <p>Please help me...
  P.S I can change photo from the admin page.</p>