-2
from django.contrib.auth.models import AbstractBaseUser, BaseUserManager, PermissionsMixin
    
class User(AbstractBaseUser, PermissionsMixin):
    email = models.EmailField(unique=True)
    name = models.CharField(max_length=150)

    objects = UserManager()

    USERNAME_FIELD = 'email'
    REQUIRED_FIELDS = ['name',]

    def __str__(self):
        return self.email

When i run makemigrations, got this error:

File "/app/core/settings.py", line 133, in <module>
    AUTH
NameError: name 'AUTH' is not defined

In end of settings.py file i have added:

AUTH_USER_MODEL = 'accounts.User'
Darwin
  • 1,695
  • 1
  • 19
  • 29

1 Answers1

0

My container was stoped. I restart container and run python manage.py makemigrations again and error go away.

Darwin
  • 1,695
  • 1
  • 19
  • 29