On Mon, Feb 11, 2013 at 7:48 AM, mack the finger <nbvf...@gmail.com> wrote:

> I created a custom User model. It has a few extra fields, most notably a
> "date_of_birth" field. Now when I try to crete a new superuser instance via
> the management command, I get this error:
>
>     TypeError: create_superuser() takes exactly 4 arguments (3 given)
>
> My "create_superuser" manager method looks like this:
>
>     def create_superuser(self, email, date_of_birth, password):
>         u = self.create_user(email, date_of_birth, password)
>         u.superuser = True
>         u.save()
>         return u
>
> The management command isn't asking for the dob... Is this a known
> shortcoming of the new custom User model, or am I not doing something right?
>

If the management command isn't asking for the date of birth, then it
sounds like you haven't put the DOB field in the list of REQUIRED_FIELDS.

https://docs.djangoproject.com/en/dev/topics/auth/customizing/#django.contrib.auth.models.CustomUser.REQUIRED_FIELDS

The other possibility is that you're not using a pre-release version of
Django 1.5. Custom user models are a new feature, and aren't available in
Django 1.4; you have to use the 1.5 release candidate or a version from git
to get this feature.

Yours,
Russ Magee %-)

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to