title: Django edit user profile
body: <p>I'm trying to create an "Edit Profile" form in the fronted. What happens is that my form(i'm not 100% sure) tries to create a user instead of finding the current user and update his profile. So I think that's the issue. Checked many questions here but none was clear enough. The fields I'm trying to edit are email, first name and last name. (Also I would like to add uda</p>
  
  <p>forms.py</p>
  
  <pre><code>class UpdateProfile(forms.ModelForm):
      username = forms.CharField(required=True)
      email = forms.EmailField(required=True)
      first_name = forms.CharField(required=False)
      last_name = forms.CharField(required=False)
  
      class Meta:
          model = User
          fields = ('username', 'email', 'first_name', 'last_name')
  
      def clean_email(self):
          username = self.cleaned_data.get('username')
          email = self.cleaned_data.get('email')
  
          if email and User.objects.filter(email=email).exclude(username=username).count():
              raise forms.ValidationError('This email address is already in use. Please supply a different email address.')
          return email
  
      def save(self, commit=True):
          user = super(RegistrationForm, self).save(commit=False)
          user.email = self.cleaned_data['email']
  
          if commit:
              user.save()
  
          return user
  </code></pre>
  
  <p>views.py</p>
  
  <pre><code>def update_profile(request):
      args = {}
  
      if request.method == 'POST':
          form = UpdateProfile(request.POST)
          form.actual_user = request.user
          if form.is_valid():
              form.save()
              return HttpResponseRedirect(reverse('update_profile_success'))
      else:
          form = UpdateProfile()
  
      args['form'] = form
      return render(request, 'registration/update_profile.html', args)
  </code></pre>