def create_superuser(self, email, password, **extra_fields):
        """Save new User with is_staff and is_superuser set to True"""
        extra_fields.setdefault('is_staff', True)
        extra_fields.setdefault('is_superuser', True)
        if extra_fields.get('is_staff') is not True:
            raise ValueError('Superuser must have is_staff=True.')
        if extra_fields.get('is_superuser') is not True:
            raise ValueError('Superuser must have is_superuser=True.')
        return self._create_user(email, password, **extra_fields)
def create_superuser ( self , email , password , ** extra_fields ) : extra_fields . setdefault ( 'is_staff' , True ) extra_fields . setdefault ( 'is_superuser' , True ) if extra_fields . get ( 'is_staff' ) is not True : raise ValueError ( 'Superuser must have is_staff=True.' ) if extra_fields . get ( 'is_superuser' ) is not True : raise ValueError ( 'Superuser must have is_superuser=True.' ) return self . _create_user ( email , password , ** extra_fields )
Save new User with is_staff and is_superuser set to True