Django 1.5 Feature Suggestion
Hello everyone,
So I want to say thanks to the Django guys for providing more support for those of us that want to use a user's email as the UID and login handler versus the previous method of handling based on the username. I and probably many others appreciate the effort given to the topic and that it was integrated into Django 1.5.
Today I would like to request a continuing expansion about this concept.
In referencing this link:
https://geekwentfreak-raviteja.rhcloud.com/2012/12/custom-user-models-in-django-1-5/
I would like to request that if we want to make email the UID we don't have to do things such as:
class MyUser(AbstractBaseUser, PermissionsMixin):
....
is_staff = models.BooleanField('staff status', default=False,
help_text='Designates whether the user can log into this admin '
'site.')
is_active = models.BooleanField('active', default=True,
help_text='Designates whether this user should be treated as '
'active. Unselect this instead of deleting accounts.')
def get_full_name(self):
full_name = '%s %s' % (self.first_name, self.last_name)
return full_name.strip()
def get_short_name(self):
return self.first_name
just to retain what could already be apart of Django. You guys know more about Django then I ever will and what the best way is to go about it but if we can eliminate additional code that is already in Django that would be wonderful.
Now in referencing:
http://stackoverflow.com/questions/16638414/set-email-as-username-in-django-1-5
Basically what I'm saying is, we shouldn't have to do what this fellow had to do:
Unfortunately there's nothing within django.contrib.auth
that you can simply subclass to get a model that has
email address in place of user name and
works nicely with other django.contrib.auth
-stuff, like groups.
The simplest approach is to copy models.py
, admin.py
and forms.py
fromdjango.contrib.auth
, rip out user name all over the place and put in email address in it's place. I've done just that and I'm using it successfully in a couple of client projects.
I've put it up on github and pypi so you can install it with
pip install django-libtech-emailuser
I thank you for your time and I appreciate your consideration for integrating this once and for all into Django.
JJ Zolper
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+unsubscribe@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.
For more options, visit https://groups.google.com/groups/opt_out.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home