title: Create a user with email which has been processed from the previous page with UserCreationForm Django
body: <p>I am trying to create a user with email as username and the email is first screened, i.e., the email is not registered then create a user. How can I pass or set the email in forms.py as it is already processed in the previous page? </p>
  
  <p>Models.py</p>
  
  <pre><code>from django.contrib.auth.models import AbstractBaseUser
  from django.db import models
  
  class CUserManager(models.Manager):
      def _create_user(self, email, password, **extra_fields):
  
          now = timezone.now();
  
          if not email:
              raise ValueError(_('Email is required'))
  
          user = self.model(
              email = email,
              date_joined = now, **extra_fields
          )
  
          user.set_password(password)  
          user.save(using = self._db)
  
          return account
  
      def create_user(self, email, password=None, **extra_fields):
          return self._create_user(email, password, **extra_fields)
  
      def get_by_natural_key(self, email):
          return self.get(email=email)
  
      def create_superuser(self, email, password, **extra_fields):
          return self._create_user(email, password,**extra_fields)
  
  class CUser(AbstractBaseUser):
  
      email = models.EmailField(_('email address'), unique=True)
      first_name = models.CharField(_('first name'), max_length=255)
      last_name = models.CharField(_('last name'), max_length=255)
      date_joined = models.DateTimeField(_('date created'), auto_now_add=True)
      is_active = models.BooleanField(default=True)    
  
      objects = CUserManager()
  
      USERNAME_FIELD = 'email'
  ...
  </code></pre>
  
  <p>Forms.py</p>
  
  <pre><code>from django.contrib.auth.forms import UserCreationForm
  
  class RegistrationForm(UserCreationForm):
  
      class Meta: 
          model = CUser
          fields = ('first_name', 'last_name', 'password1', 'password2')
  </code></pre>
  
  <p>in HTML</p>
  
  <pre><code> &lt;form action=""  method="post" role="form"&gt;
      {% csrf_token %}
    {{ form.as_p }}
    &lt;input type="submit" value="Submit" /&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>The email comes from session['email'] which is saved in the previous page. </p>
  
  <p>How can I pass this session['email'] to forms.py?</p>