text: from django.contrib.auth.forms import UserCreationForm
  from django import forms
  from django.contrib.auth.models import User
  
  
  class CreateUserForm(UserCreationForm):
      first_name = forms.CharField(max_length=32)
      last_name = forms.CharField(max_length=32)
  
      class Meta:
          model = User
          fields = ['username', 'first_name', 'email', 'last_name', 'password1', 'password2']
  
      def clean_email(self):
          email = self.cleaned_data.get('email')
          username = self.cleaned_data.get('username')
          if email and User.objects.filter(email=email).exclude(username=username).exists():
              raise forms.ValidationError(u'Email addresses must be unique.')
          return email