class User(AbstractBaseUser, PermissionsMixin): email = models.EmailField(_('email address'), unique=True) password = models.CharField(_('password'), max_length=255, blank=False) first_name = models.CharField(_('first name'), max_length=30, blank=True) last_name = models.CharField(_('last name'), max_length=30, blank=True) date_joined = models.DateTimeField(_('date joined'), auto_now_add=True) is_active = models.BooleanField(_('active'), default=True) is_staff = models.BooleanField(_('staff status'), default=False) avatar = models.CharField(_('avatar'), max_length=30, blank=True, null=True) #models.ImageField(upload_to='avatars/', null=True, blank=True)
objects = UserManager()
USERNAME_FIELD = 'email' REQUIRED_FIELDS = []
class Meta: verbose_name = _('user') verbose_name_plural = _('users')
AUTH_USER_MODEL = 'user.User'
python manage.py createsuperuser
django.db.utils.OperationalError: no such table: user_user
python manage.py makemigrations user
python manage.py makemigrations
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/cfca6c60-4626-470c-afa3-5213862e4dfb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
python manage.py makemigrations my_app
python manage.py migrate