def CreateUser(self,validate_data):
password = validate_data.pop('password',None)
instance = self.Meta.model(**validate_data)
if password is not None:
instance.set_password(password)
instance.save()
return instance
Please post your Meta
model, along with the complete view here.