I actually migrated my site to 1.7 and added a custom user model very 
easily. Here's a gist with the 
code, https://gist.github.com/micahhausler/63636f26cc87bb966218, but 
essentially all I had to do was add a new user app, copy the Django 
AbstractUser code, and set the db_table to 'auth_user'.


class User(AbstractBaseUser, PermissionsMixin):
 
    objects = UserManager()
 
    class Meta:
        db_table = 'auth_user'



Does anyone think this method could be worth adding to the Django 
documentation? I'd be happy to open a ticket/write the docs. The only side 
effect would be that if someone were using content-types for auth_user 
objects, that would need to be migrated.
 
Micah Hausler


On Friday, February 6, 2015 at 8:10:02 PM UTC-5, Collin Anderson wrote:
>
> Hi All,
>
> I was reminded by:
> Allow shadowing of abstract fields 
> https://groups.google.com/d/msg/django-developers/6zUfnElOIks/8uwXji559EsJ
> and https://code.djangoproject.com/ticket/24288 (Custom User Models for 
> small tweaks).
>
> Could we reopen https://code.djangoproject.com/ticket/20846 and increase 
> User.username max_length to 254?
>
> Personally, that's the only thing I've ever needed to change about my User 
> class. I just need it long enough to hold email addresses. I've seen many 
> other people wanting the same thing.
>
> In 1.8 we migrated the length of EmailField from 75 to 254, so it should 
> be almostâ„¢ as easy to change the username field.
>
> If needed, we could keep the 30-character limit on UserCreationForm and 
> UserChangeForm for backwards compatibility. The limit in the database is 
> the real killer :) Though, consistency is also nice.
>
> Thanks,
> Collin
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/a845dfa4-57b7-4926-91d2-6b2e74eee651%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to