Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Django social auth GitHub authentication

I'm new to Python and Django and am trying to get social auth (https://github.com/omab/django-social-auth) to work. I'd like to connect using Github, but am not having much success and the example provided is a bit overwhelming to someone starting out. Are there any recent tutorials available that explain how to use the latest version of social auth to setup GitHub authentication to a beginner?

like image 806
wwwuser Avatar asked Feb 20 '23 04:02

wwwuser


1 Answers

Did you read the documentation provided here

After installing the app, you need to do a bunch of configuration including specifying the Github backend

You might also want to read up about the OAuth Protocol and what are all the tokens you need and how to obtain them.

If you need to access github specific API's only, I would encourage you to look into PyGithub

The authentication is as simple as doing g = Github( token ) where token is from oauth.

Reading repos is as follows

for repo in g.get_user().get_repos():
    print repo.name
    repo.edit( has_wiki = False ) 

A related question to this is Most suitable python library for Github API v3

like image 66
Pratik Mandrekar Avatar answered Feb 22 '23 05:02

Pratik Mandrekar