Authentication using Facebook

In order to let your users log in with their Facebook account to your site, add the following line to the AUTHENTICATION_BACKENDS setting in the settings.py file of your project:

'social_core.backends.facebook.FacebookOAuth2',

In order to add social authentication with Facebook, you will need a Facebook developer account and to create a new Facebook application. Open https://developers.facebook.com/apps/ in your browser. You will see the following header in the site:

Click on the Add a New App button. You will see the following form to create a new app ID:

Enter Bookmarks as Display Name, add a contact email ...

Get Django 2 by Example now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.