Do not subclass the User model. Create a profile model and register
that with the auth app, which is how the authentication documentation
tells you to go about this.

http://docs.djangoproject.com/en/dev/topics/auth/#storing-additional-information-about-users

On Sun, Mar 27, 2011 at 10:54 AM, Kees Hink <h...@gw20e.com> wrote:
> I'm subclassing django.contrib.auth.models.User to create a custom
> user type (Student) with extra fields, following
> http://scottbarnham.com/blog/2008/08/21/extending-the-django-user-model-with-inheritance/.
> (Is there no documentation on djangoproject.org on how to do this?)
> Some relevant snippets of code: http://pastie.org/1721216
>
> I've create a Student and given the account "staff" status, to be able
> to log in to the admin interface. The Student can't log in there,
> however. When i create a User in the same way, that User can log in.
>
> Also i noticed the password is saved unhashed: i can read the password
> i typed from the edit form. Password reset form doesn't work:
> http://pastie.org/1721206 Another thing i noticed: adding a Student
> also ads a User, but removing the Student doesn't remove the User.
>
> What am i doing wrong?
>
> Kees
>
> --
> 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.
>
>



-- 
Read my blog! I depend on your acceptance of my opinion! I am interesting!
http://techblog.ironfroggy.com/
Follow me if you're into that sort of thing: http://www.twitter.com/ironfroggy

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