Authentication using Twitter

For social authentication using Twitter, add the following line to the AUTHENTICATION_BACKENDS setting in the settings.py file of your project:

'social_core.backends.twitter.TwitterOAuth',

You will need to create a new application in your Twitter account. Open https://apps.twitter.com/app/new in your browser. You will see the following form:

Enter the details of your application, including the following settings:

  • Website: http://mysite.com:8000/
  • Callback URL: http://mysite.com:8000/social-auth/complete/twitter/

Then, click on Create your Twitter application. You will see the application details. Click on Keys ...

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.