Hey L,

On Mon, Mar 18, 2013 at 9:13 AM, Lachlan Musicman <data...@gmail.com> wrote:
> Hola,
>
> For a new project, I will be creating a separate Profile class for all
>  information about my Users that isn't covered by User.
>
> One thing I did want though, was to change the login username to the
> email address.
>
> From what I've read in the code and docs, am I right in presuming that
> I can subclass AbstractUser and just change
>   USERNAME_FIELD = 'email'
> to get this result?
>

That seemed to work, yes. The problem I had, though, was once I made
this change, adding users in the default admin became totally broken,
and I did not find a way to fix that easily. Please do let know if you
manage to do this in a way that doesn't break the admin functionality
to add users (if you don't get care about Admin to manage users, this
should work no problem .. ).

Please do share what works out though - I was extremely excited about
the new Abstract User class, but found subclassing AbstractUser and
maintaining admin usability to manage users really hard to accomplish,
some-how. Let me know if you want me to post more details on what
issues I encountered and what I tried ..

Cheers :)
-Sanjay


> All of the examples I've seen* suggest going all the way to
> AbstractBaseUser - but I'm ok with AbstractUser, I just want the
> single change?
>
> Cheers
> L.
>
>
> *pydanny's 2 scoops and the docs here:
> https://docs.djangoproject.com/en/1.5/topics/auth/customizing/#django.contrib.auth.models.CustomUser
> https://docs.djangoproject.com/en/1.5/topics/auth/customizing/#a-full-example 
> )
>
>
> cheers
> L.
>
>
> --
> The new creativity is pointing, not making. Likewise, in the future,
> the best writers will be the best information managers.
>
> http://www.theawl.com/2013/02/an-interview-with-avant-garde-poet-kenneth-goldsmith
>
> --
> 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.
>
>

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