Thursday, March 21, 2013

Re: [ver. 1.5] Specifying custom User model (extends AbstractUser) doesn't work

And this is why I learnt the names of many of those major in the Django community! Now if I post after them, it's mostly to say..... Yes I agree.

Like I'm doing now :-)

On Wednesday, 24 October 2012 05:02:02 UTC+1, Surya Mukherjee wrote:
Django's standard User class isn't sufficient for my needs so I am making my own User class. As per the User Authentication doc page, I am subclassing AbstractUser (not AbstractBaseUser) to add some new stuff.

____
from django.contrib.auth.models import AbstractUser

class MyUser(AbstractUser):
        test = 'Hello world'
____

Pretty simple so far. In settings.py:
____
# Specifies SDBUser as the custom User class for Django to use
AUTH_USER_MODEL = 'app.MyUser'
____

But when i try to syncdb, everything breaks:

[root@Surya project]# manage syncdb
CommandError: One or more models did not validate:
app.userprofile: 'user' defines a relation with the model 'auth.User', which has been swapped out. Update the relation to point at settings.AUTH_USER_MODEL.
auth.user: Model has been swapped out for 'app.SDBUser' which has not been installed or is abstract.
django_openid_auth.useropenid: 'user' defines a relation with the model 'auth.User', which has been swapped out. Update the relation to point at settings.AUTH_USER_MODEL.

django_openid_auth is a third party OpenID library, but the first two are pure Django and they're still breaking. Wat do?

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