Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I had the same problem , in my case I had this:</p> <pre><code>class Estudiante(AbstractBaseUser,PermissionsMixin): name = models.CharField(max_length=250,null=False,blank=False) email = models.EmailField( verbose_name='Direccion de correo Electronico', max_length=255, unique=True, db_index=True, ) is_staff = models.BooleanField(u'staff status', default=False, help_text=u'Designates whether the user can log into this admin ' 'site.') is_active = models.BooleanField(u'active', default=True, help_text=u'Designates whether this user should be treated as ' 'active. Unselect this instead of deleting accounts.') objects = MyUserManager() USERNAME_FIELD = 'email' REQUIRED_FIELDS = ['name'] def get_full_name(self): # The user is identified by their email address return self.name def get_short_name(self): # The user is identified by their email address return self.email def __unicode__(self): return self.email def has_perm(self, perm, obj=None): "Does the user have a specific permission?" # Simplest possible answer: Yes, always return True def has_module_perms(self, app_label): "Does the user have permissions to view the app `app_label`?" # Simplest possible answer: Yes, always return True </code></pre> <p>and MyUserManager:</p> <pre><code>class MyUserManager(BaseUserManager): def create_user(self, name,email, password=None): .... return user def create_superuser(self, name,email, password): """ Creates and saves a superuser with the given email, date of birth and password. """ user = self.model( email=MyUserManager.normalize_email(email), name=name, ) user.is_staff = True user.is_active = True user.is_superuser = True user.set_password(password) user.save(using=self._db) return user </code></pre> <p>I fixed the problem commented or eliminate the methods "has_perm" and has_module_perms</p> <pre><code>class Estudiante(AbstractBaseUser,PermissionsMixin): name = models.CharField(max_length=250,null=False,blank=False) email = models.EmailField( verbose_name='Direccion de correo Electronico', max_length=255, unique=True, db_index=True, ) is_staff = models.BooleanField(u'staff status', default=False, help_text=u'Designates whether the user can log into this admin ' 'site.') is_active = models.BooleanField(u'active', default=True, help_text=u'Designates whether this user should be treated as ' 'active. Unselect this instead of deleting accounts.') objects = MyUserManager() USERNAME_FIELD = 'email' REQUIRED_FIELDS = ['name'] def get_full_name(self): # The user is identified by their email address return self.name def get_short_name(self): # The user is identified by their email address return self.email def __unicode__(self): return self.email </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload