Github

INSTALLED_APPS = [
  
    'allauth.socialaccount.providers.github', # new (github provider)
 
]

GitHub OAuth

Now open https://github.com/settings/applications/new to get configure the OAuth app in GitHub. You will get a client ID and secret key.

Fill up the details and for

  • Homepage URL: http://localhost:8000/

  • Authorization callback URL: http://localhost:8000/accounts/github/login/callback/

Then click on Register application

Now log out yourself because you logged in as a superuser and open http://localhost:8000/accounts/login/arrow-up-right and you can see GitHub login option.

If you have customized django-allauth templatesarrow-up-right then you can directly use this code in your template.

Last updated