pennersr / django-allauth

Integrated set of Django applications addressing authentication, registration, account management as well as 3rd party (social) account authentication.
https://allauth.org
MIT License
9.41k stars 3.01k forks source link

suggestion: no need for ACCOUNT_USER_MODEL_USERNAME_FIELD in django? #1352

Closed hjwp closed 8 years ago

hjwp commented 8 years ago

Django custom user models require that you specify an attribute USERNAME_FIELD on your model, so could django-allauth just read this, rather than repeating the information in an additional settings.py entry?

https://docs.djangoproject.com/en/1.9/topics/auth/customizing/#django.contrib.auth.models.CustomUser.USERNAME_FIELD

http://django-allauth.readthedocs.org/en/latest/advanced.html?highlight=username%20field#custom-user-models

pennersr commented 8 years ago

No. Quoting the Django documentation: "This will usually be a username of some kind, but it can also be an email address, or any other unique identifier" ... allauth requires a clear distinction between true username fields and email fields.

hjwp commented 8 years ago

Ah, I see. I use email as my username, so that's why I wanted it. Thanks for replying.

pennersr commented 8 years ago

Conceptually, you do not have a username field. So, set ACCOUNT_USER_MODEL_USERNAME_FIELD to None

HalfDeadPie commented 7 months ago

I'd like to ask how can I set username as Keycloak ID, please.