@@ -0,0 +1,1053 @@
+from django.contrib.auth.base_user import BaseUserManager%0A%0A%0Aclass UserManager(BaseUserManager):%0A    use_in_migrations = True%0A%0A    def _create_user(self, email, password, **extra_fields):%0A        %22%22%22%0A        Creates and saves a User with the given email and password.%0A        %22%22%22%0A        if not email:%0A            raise ValueError('The given email must be set')%0A        email = self.normalize_email(email)%0A        user = self.model(email=email, **extra_fields)%0A        user.set_password(password)%0A        user.save(using=self._db)%0A        return user%0A%0A    def create_user(self, email, password=None, **extra_fields):%0A        extra_fields.setdefault('is_superuser', False)%0A        return self._create_user(email, password, **extra_fields)%0A%0A    def create_superuser(self, email, password, **extra_fields):%0A        extra_fields.setdefault('is_superuser', True)%0A%0A        if extra_fields.get('is_superuser') is not True:%0A            raise ValueError('Superuser must have is_superuser=True.')%0A%0A        return self._create_user(email, password, **extra_fields)%0A

Add custom UserManager