title: Extended User model in django not saving profile image
body: <p>Am trying to create a chat forum in django . but to do this i needed to extend the User Model, But after extending it the profile image does not save 
  This is my model</p>
  
  <pre><code>class Profile(models.Model):
  user = models.OneToOneField(User, on_delete=models.CASCADE)
  email = models.EmailField()
  img = models.FileField(upload_to='media/', blank=True, null=True)
  
  def __str__(self):
      return self.user.username
  @receiver(post_save, sender=User)
  def update_user_profile(sender, instance, created, **kwargs):
  if created:
      Profile.objects.create(user=instance)
  instance.profile.save()
  </code></pre>
  
  <p>My View:</p>
  
  <pre><code>def signup(request):
  if request.method == 'POST':
      form = SignUpForm(request.POST)
      if form.is_valid():
          user = form.save()
          user.refresh_from_db()  # load the profile instance created by the signal
          user.profile.email = form.cleaned_data.get('email')
          user.profile.img = form.cleaned_data.get('img')
          user.save()
          raw_password = form.cleaned_data.get('password1')
          user = authenticate(username=user.username, password=raw_password)
          login(request, user)
          return redirect('home')
  else:
      form = SignUpForm()
  return render(request, 'tforum/signup.html', {'form': form})
  </code></pre>
  
  <p>My Forms.py</p>
  
  <pre><code>class SignUpForm(UserCreationForm):
  email = forms.EmailField(help_text='Required.')
  img = forms.FileField(help_text='Upload Image')
  class Meta:
      model = User
      fields = ('username', 'email', 'img', 'password1', 'password2', )
  </code></pre>
  
  <p>Signup.html</p>
  
  <pre><code> &lt;form method="post" enctype="multipart/form-data"&gt;
  {% csrf_token %}
  {% for field in form %}
    &lt;p&gt;
      {{ field.label_tag }}&lt;br&gt;
      {{ field }}
      {% if field.help_text %}
        &lt;small style="color: grey"&gt;{{ field.help_text }}&lt;/small&gt;
      {% endif %}
      {% for error in field.errors %}
        &lt;p style="color: red"&gt;{{ error }}&lt;/p&gt;
      {% endfor %}
    &lt;/p&gt;
  {% endfor %}
  &lt;button type="submit"&gt;Sign up&lt;/button&gt;
  </code></pre>
  
  <p></p>
  
  <p>settings.py</p>
  
  <p>STATIC_URL = '/static/'</p>
  
  <p>MEDIA_URL = '/media/'
  MEDIA_ROOT =  os.path.join(BASE_DIR, 'media')</p>
  
  <p>The problem is that the user is not created. 
  If i remove the img from the code the user saves.</p>
  
  <p>I have stripped away most of the styling</p>