Selecting Auth Backend
00:00 Selecting an Authentication Backend.
00:05 There’s one problem with the example you’ve just seen. By enabling GitHub login, you accidentally broke the normal user creation process. This happened because Django previously had only one authentication backend to choose from, and now it has two. Django doesn’t know which one to use when creating new users. So you need to help it decide.
To do that, make the changes seen-on screen in the registration view. As before, a user is created from the form data, but this time it’s not immediately saved thanks to
commit=False. In the next line, a backend is associated with the user, and only then is the user saved to the database.
00:49 This way, you can use both normal user creation and social media authentication in the same Django user management system.
00:59 Now that you’ve covered everything in the course, in the next section, you’ll take a look back at what you’ve learned.
Become a Member to join the conversation.