Friday, January 25, 2013

Re: [ver 1.5] AbstractBaseUser not found?

Thanks, Joey! Would've saved me a lot of time if they'd included that in the example!

-s

On Friday, January 25, 2013 7:04:08 AM UTC-8, JoeLinux wrote:
Scott,

There is no django.db.models.AbstractBaseUser model. Try adding this to your import statements:

    from django.contrib.auth.models import AbstractBaseUser

Hope that helps.

--
Joey "JoeLinux" Espinosa



On Fri, Jan 25, 2013 at 10:02 AM, scott212 <scottw...@gmail.com> wrote:
Here's the docs I'm using: https://docs.djangoproject.com/en/dev/topics/auth/customizing/#specifying-a-custom-user-model


On Friday, January 25, 2013 7:00:47 AM UTC-8, scott212 wrote:
I'm trying to take Django 1.5 for a spin (used older versions for a while) to create a basic user that authenticates by email. I'm using the docs for 1.5 and it says to inherit AbstractBaseUser but oddly, it doesn't seem to be available to use. Here's my code:

from django.db import models

class User(models.AbstractBaseUser):    
    identifier = models.EmailField(max_length=254)
    first_name = models.CharField()
    last_name  = models.CharField()
    
    REQUIRED_FIELDS = ['first_name','last_name']

Here's what I get back from syncdb:

new-host-2:locations_site scott$ python manage.py syncdb
AttributeError: 'module' object has no attribute 'AbstractBaseUser'

I've tried the import every different way I can think of. What am I missing?


--
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.

--
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+unsubscribe@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.
 
 

No comments:

Post a Comment