Basically, I am using Person class as my AUTH_USER_MODEL. I realized it was
missing 'username' in REQUIRED_FIELDS.

from django.contrib.auth.models import UserManager, AbstractBaseUser
...

class Person(AbstractBaseUser):
    objects = UserManager()
    username = models.CharField(_('username'), max_length=30, unique=True,
        help_text=_('Required. 30 characters or fewer. Letters, numbers and
'
                    '@/./+/-/_ characters'))
    email = models.EmailField(_('e-mail address'), unique=True, blank=True,
null=True)
...
    USERNAME_FIELD = 'email'
    REQUIRED_FIELDS = ['username']

But it continues to give me error to syncdb:
You just installed Django's auth system, which means you don't have any
superusers defined.
Would you like to create one now? (yes/no): yes
E-mail address: e...@il.xx
Username: test
Password:
Password (again):
TypeError: 'is_active' is an invalid keyword argument for this function

There is no is_active reference in my model.

2013/1/8 Russell Keith-Magee <russ...@keith-magee.com>

>
> On Tue, Jan 8, 2013 at 5:46 AM, Thiago Carvalho D' Ávila <
> thiagocav...@gmail.com> wrote:
>
>> I used auth mixin before in my app, then made the changes to make it work
>> on the official Django with new custom user.
>>
>> The problem is that, when I run on my new empty db:
>> python manage.py syncdb --all
>>
>> ...
>> You just installed Django's auth system, which means you don't have any
>> superusers defined.
>> Would you like to create one now? (yes/no): yes
>> E-mail address: e...@il.xx
>> Password:
>> Password (again):
>> TypeError: create_superuser() takes exactly 4 arguments (3 given)
>>
>> Do you know what is wrong?
>
>
> It's impossible to tell you the exact problem without seeing code, but
> from the look of it, your user manager isn't defined correctly.
>
> The arguments of the create_superuser() method on your user manager must
> match the required fields on your user model (i.e., the contents of
> REQUIRED_FIELDS, plus username and password). Based on the error you're
> describing, you've defined a create_superuser() that takes an argument that
> isn't listed as a required field.
>
> Yours,
> Russ Magee %-)
>
>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to