text: from django.db import models
  from django.contrib.auth.models import AbstractBaseUser
  from django.contrib.auth.models import PermissionsMixin
  from django.contrib.auth.models import BaseUserManager
  
  
  class UserProfileManager(BaseUserManager):
      
      
      def create_user(self, email, name, password=None):
          if not email:
              raise ValueError('User must have an email address')
          
          email = self.normalize_email(email)
          # 여기있는 model은 도대체 뭐임?? 단지 custom model 에 대한 참조라는데 먼 개소리지
          user = self.model(email=email, name=name)
          
          user.set_password(password)
          user.save(using=self._db)
          
          return user
      
      
      def create_superuser(self, email, name, password):
          user = self.create_user(email, name, password)
          
          user.is_superuser = True
          user.is_staff = True
          user.save(using=self._db)
          
          return user
  
  
  
  class UserProfile(AbstractBaseUser, PermissionsMixin):
      """Database model for users in the system"""
      email = models.EmailField(max_length=255, unique=True)
      name = models.CharField(max_length=255)
      is_active = models.BooleanField(default=True)
      is_staff = models.BooleanField(default=False)
      
      objects = UserProfileManager()
      
      USERNAME_FIELD = 'email'
      REQUIRED_FIELDS = ['name']
      
      def get_full_name(self):
          return self.name
      
      def get_short_name(self):
          return self.name
      
      def __str__(self):
          return self.email
      
  