3 ms·
I've been using only email-based auto for years with Django. It's fully supported and very easy to use[1]. 1. https://docs.djangoproject.com/en/1.9/topics/auth
by mangeletti 11y ago
I've been using only email-based auto for years with Django. It's fully supported and very easy to use[1].
1. https://docs.djangoproject.com/en/1.9/topics/auth/customizing/#django.contrib.auth.models.CustomUser.USERNAME_FIELD https://docs.djangoproject.com/en/1.9/topics/auth/customizin...
- pbreit 11y agoSo that's it? I've never seen that before. Everything I saw seemed more complicated from installing various auth addons to multi-file edits and finger-crossing. And I don't see how assertions like this can be made: "This will usually be a username of some kind, but it can also be an email address" Except for HN, Twitter & Reddit, are there any services that don't use email for login?
- jsmeaton 11y ago> Except for HN, Twitter & Reddit, are there any services that don't use email for login? I guess sites that use the username as a form of identity within a site. Email address usernames are just identifiers and contact information, without really being linked to an identity. I would think if auth was being written from scratch it'd probably default to email based usernames. That ship has sailed though.
- pbreit 11y agoBut it shouldn't have sailed. Frameworks need to keep up with the times. That should be a benefit of frameworks. Should be possible while preserving backwards compatibility.
- Scarblac 11y agoNote that database migrations weren't part of Django until 1.7, before that they were provided by an external app (South). Which meant that Django's database models couldn't migrate. Even now, there is no real way to start with Django's own User model and switch your project over to a custom one later (because you'd have many database tables with foreign keys to the Django one). The current recommendation is to start new projects with a custom User model always.