title: Django all-auth custom signup form with custom user model
body: <p>So I have a project that uses a custom UserModel, the default UserModel is extended to use a Profile model with a OneToOne relation to the Usermodel.</p>
  
  <p>I would like to use django allauth to verify emailaddresses and add social login. </p>
  
  <p>I have some issues with the custom signup, I've read the following <a href="https://stackoverflow.com/questions/12303478/how-to-customize-user-profile-when-using-django-allauth:">How to customize user profile when using django-allauth</a>, but it's not entirely clear how to implement this, I get an error; </p>
  
  <blockquote>
    <p>'GuestSignUpForm' object has no attribute 'save'</p>
  </blockquote>
  
  <p>I've searched the forum and there seems to be no "official" documentation on how to do this, some people use ModelForms, others inherit from SignUpView, some def signup and others use def save...</p>
  
  <p>I tried customizing the default UserModel with UserCreationForm and had no issues, I just need some clarification on the inner workings of the allauth package</p>
  
  <h1>models.py</h1>
  
  <pre><code># Custom Usermodel 
  class User(AbstractUser):
      pass
  
  # Custom Profile model to store additional info
  class Profile(models.Model):
      prefix = models.CharField(_('prefix'), max_length=8, blank=True, default="")
      user = models.OneToOneField(User, on_delete=models.CASCADE, related_name='profile')
      # Other fields left out for readability
  
      def __str__(self):
          if self.prefix:
              return '%s %s, %s' % (self.user.last_name, self.prefix, self.user.first_name)
          else:
              return '%s %s' % (self.user.last_name, self.user.first_name)
  
  # Create a profile record on save
  @receiver(post_save, sender=User)
  def create_user_profile(sender, instance, created, **kwargs):
      if created:
          Profile.objects.create(user=instance)
      else:
          instance.profile.save()
  </code></pre>
  
  <h1>forms.py</h1>
  
  <pre><code>from django import forms
  from allauth.account.forms import SetPasswordField, PasswordField
  
  from .models import User, Profile
  
  class GuestSignUpForm(forms.Form):
      first_name = forms.CharField(max_length=30)
      prefix = forms.CharField(max_length=8, required=False)
      last_name = forms.CharField(max_length=150)
      email = forms.EmailField(required=True)
      password1 = SetPasswordField()
      password2 = PasswordField()
  
      def signup(self, request, user):
          user.first_name = self.cleaned_data['first_name']
          user.last_name = self.cleaned_data['last_name']
          user.save()
          profile = Profile.objects.get(user=user)
          profile.prefix = self.cleaned_data.get['prefix']
          profile.save()
          return user
  </code></pre>