Syncdb error with new 1.5rc1

200 views
Skip to first unread message

Thiago Carvalho D' Ávila

unread,
Jan 7, 2013, 4:46:18 PM1/7/13
to Django Users
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?

Russell Keith-Magee

unread,
Jan 7, 2013, 9:21:03 PM1/7/13
to django...@googlegroups.com
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 %-)

 

Thiago Carvalho D' Ávila

unread,
Jan 8, 2013, 7:46:41 AM1/8/13
to django...@googlegroups.com
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 <rus...@keith-magee.com>

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

galgal

unread,
Jan 8, 2013, 8:25:15 AM1/8/13
to django...@googlegroups.com

Thiago Carvalho D' Ávila

unread,
Jan 8, 2013, 9:23:22 AM1/8/13
to django...@googlegroups.com
I found out what I was doing wrong in my model. I was using UserManager without having 'is_active' and 'is_admin' fields. Solved!

As with galgal's problem. I had no luck using South to migrate from auth_mixin to django 1.5. I am doing it manually =/

2013/1/8 galgal <weglare...@gmail.com>
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/N6aoa9nWW9IJ.

galgal

unread,
Jan 8, 2013, 1:14:32 PM1/8/13
to django...@googlegroups.com
As for my problem, I solved it by making manage.py migrate --fake
But I don't know that is the best and good solution. So far it works somehow :)
Reply all
Reply to author
Forward
0 new messages