On Tue, Sep 25, 2012 at 9:57 AM, Bill Beal <[email protected]> wrote:
> Hi all,
>
> I want to use the email address as the username for registration and login.
> I'm using django-registration for 2-stage registration.  I'm looking for an
> easier way than what I've come up with so far.  I can modify registration
> and activation, but then django.contrib.auth.views.login has a 30-character
> limit on the username.  I'm not looking forward to making username act like
> an email address.  Any quick fixes?

The quick and nasty fix -- issue the ALTER statement on your database
to make the field longer, and define custom forms that enforce the new
field length. Provide those custom forms to the auth login views, etc.

The slightly better fix -- fork Django (or, at least,
django.contrib.auth) for the purposes of your local deployment, and
modify the 30 character constraint wherever it occurs.

The real fix: I'm about to land a new feature for Django 1.5 that will
allow you to install a custom your User model that has whatever
properties you want (e.g., a longer username field, only an email
field, twitter handle instead of username, etc). If you want to test
this branch, you can check out my Github repo [1], or wait a day or
two and try it out on the Django development branch (that will
eventually become 1.5).

[1] https://github.com/freakboy3742/django/tree/t3011

Yours,
Russ Magee %-)

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to