Re: Using email instead of username in extended "User" model?

2009-08-09 Thread Saikat Chakrabarti
Just some more info on this - I use http://www.davidcramer.net/code/224/logging-in-with-email-addresses-in-django.html for logging in using emails. There is some discussion of this topic on http://groups.google.com/group/django-users/browse_thread/thread/c943ede66e6807c/2fbf2afeade397eb?pli=1

Re: Using email instead of username in extended "User" model?

2009-08-04 Thread Dana Woodman
Yeah that seems like the option Ill go with since it is probably the most clean and future compatible. My user's dont need to log into django admin anyways so that should suffice. Thanks everyone for the feedback! Cheers, Dana On Mon, Aug 3, 2009 at 4:23 PM, Malcolm Tredinnick

Re: Using email instead of username in extended "User" model?

2009-08-03 Thread Malcolm Tredinnick
On Mon, 2009-08-03 at 13:13 -0700, Dana wrote: > Ok, I understand the login part but what about registration? Wouldn't > the user's need a username still? Or am I misunderstanding... And what > about Django admin, it would still need a username correct? Nothing stops you from creating a random

Re: Using email instead of username in extended "User" model?

2009-08-03 Thread prabhu S
Going a step backward, why cant you make username same as email. Have a custom login_required decorator that uses email and password to authenticate, override registeration pages and not show username field? It seems to work for me. On Aug 2, 4:38 pm, Dana wrote: >

Re: Using email instead of username in extended "User" model?

2009-08-03 Thread djangou...@gmail.com
+1 thought that from the beginning! -- Sent from my Palm Pre Dana wrote: Yes, I agree that this is probably the best way to do it as I see now and I may well do that change, Im just hoping that Im missing some way to get around hacking up Django to get what I want... This seems like the one

Re: Using email instead of username in extended "User" model?

2009-08-03 Thread Elliott
Another way to do it is to create subclasses of all the relevant classes and forms. It's easy enough to create middleware that replaces django's default user object with your own, and it's also very easy to set the admin up to use your user model instead of the default. On Aug 3, 3:15 pm, Dana

Re: Using email instead of username in extended "User" model?

2009-08-03 Thread Dana
Yes, I agree that this is probably the best way to do it as I see now and I may well do that change, Im just hoping that Im missing some way to get around hacking up Django to get what I want... This seems like the one thing in the framework that is suboptimal... too bad because it is so crucial.

Re: Using email instead of username in extended "User" model?

2009-08-03 Thread Dana
Ok, I understand the login part but what about registration? Wouldn't the user's need a username still? Or am I misunderstanding... And what about Django admin, it would still need a username correct? On Aug 2, 8:44 pm, Malcolm Tredinnick wrote: > On Sun, 2009-08-02 at

Re: Using email instead of username in extended "User" model?

2009-08-03 Thread cootetom
When I first started using django I was surprised that it limited usernames and didn't allow email address's by default. It is probably the only thing in the whole framework that I have wanted to change. Yes it would be nice to have a clear solution rather than the approach I have taken which is

Re: Using email instead of username in extended "User" model?

2009-08-02 Thread Malcolm Tredinnick
On Sun, 2009-08-02 at 20:21 -0700, Dana wrote: > Oops i mean username, not password. > > Im not clear on how I can get this to override the django login > functionality. Im reading more up on custom auth backends but Ill > admit it's a little confusing. You write a custom authentication

Re: Using email instead of username in extended "User" model?

2009-08-02 Thread Dana
Oops i mean username, not password. Im not clear on how I can get this to override the django login functionality. Im reading more up on custom auth backends but Ill admit it's a little confusing. Anyone have a finished example of how I can get Django to use email to login (either by making

Re: Using email instead of username in extended "User" model?

2009-08-02 Thread Dana
Tried using that but seems to not do what I need. I couldn't get an email address to save as a password and I am not willing to modify Django or hack my database to do it just yet. On Aug 2, 9:21 am, Darek wrote: > tips: Email addresses for user >

Re: Using email instead of username in extended "User" model?

2009-08-02 Thread Dana
Modification of Django code is not really a path I want to take, I'd prefer a cleaner approach, but thanks for the suggestion! On Aug 2, 11:39 am, cootetom wrote: > Another option you have is to modify the User model directly in the > django source code. > > You will need to

Re: Using email instead of username in extended "User" model?

2009-08-02 Thread Russell Keith-Magee
On Sun, Aug 2, 2009 at 11:56 PM, David Koblas wrote: > > Just to add my $0.02 cents to this, I too would like a better way to > extend django.contrib.auth.models.User than the current approach.  The > two biggest "problems" that I have are: > > * Everything depends on

Re: Using email instead of username in extended "User" model?

2009-08-02 Thread cootetom
Another option you have is to modify the User model directly in the django source code. You will need to edit: django.contrib.auth.models.User django.contrib.auth.forms.UserCreationForm django.contrib.auth.forms.AuthenticationForm Find the username field and use the forms.EmailField instead.

Re: Using email instead of username in extended "User" model?

2009-08-02 Thread Darek
tips: Email addresses for user name: http://www.djangosnippets.org/snippets/74/ On Aug 2, 5:38 pm, Dana wrote: > Hello All, > > I am looking to create a user model that extends the Auth "User" > model, like how James Bennett outlines in his article "Extending the > User

Re: Using email instead of username in extended "User" model?

2009-08-02 Thread David Koblas
Just to add my $0.02 cents to this, I too would like a better way to extend django.contrib.auth.models.User than the current approach. The two biggest "problems" that I have are: * Everything depends on django.contrib.auth.models.User -- which means that while you could swap out your

Using email instead of username in extended "User" model?

2009-08-02 Thread Dana
Hello All, I am looking to create a user model that extends the Auth "User" model, like how James Bennett outlines in his article "Extending the User Model" [1] by creating a FK to the "User" model and everything is going fine other than one issue. I would like to make "email" become the unique