'Creates and saves a User with the given username, email and password.'

def create_user(self, username, email=None, password=None, **extra_fields):

    now = timezone.now()
    if (not username):
        raise ValueError(u'The    given    username    must    be    set')
    email = UserManager.normalize_email(email)
    user = self.model(username=username, email=email, is_staff=False, is_active=True, is_superuser=False, last_login=now, date_joined=now, **extra_fields)
    user.set_password(password)
    user.save(using=self._db)
    return user
