本文整理匯總了Python中github.GitHub.authorize_url方法的典型用法代碼示例。如果您正苦於以下問題:Python GitHub.authorize_url方法的具體用法?Python GitHub.authorize_url怎麽用?Python GitHub.authorize_url使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.GitHub
的用法示例。
在下文中一共展示了GitHub.authorize_url方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: Flask
# 需要導入模塊: from github import GitHub [as 別名]
# 或者: from github.GitHub import authorize_url [as 別名]
from github import GitHub
import requests
from keys import *
app = Flask(__name__)
ig_client = instagram.client.InstagramAPI(client_id=INSTAGRAM_CLIENT_ID, client_secret=INSTAGRAM_CLIENT_SECRET, redirect_uri=INSTAGRAM_REDIRECT_URI)
ig_auth_url = ig_client.get_authorize_url()
fsq_client = foursquare.Foursquare(client_id=FOURSQUARE_CLIENT_ID, client_secret=FOURSQUARE_CLIENT_SECRET, redirect_uri=FOURSQUARE_REDIRECT_URI)
fsq_auth_uri = fsq_client.oauth.auth_url()
gh_client = GitHub(client_id=GITHUB_CLIENT_ID, client_secret=GITHUB_CLIENT_SECRET)
gh_auth_uri = gh_client.authorize_url()
auth_uris = {
'ig': ig_auth_url,
'gh': gh_auth_uri,
'fsq': fsq_auth_uri
}
@app.route('/')
def index():
services_logged_in = {}
fb_access_token = request.cookies.get('fb_access_token')
ig_access_token = request.cookies.get('ig_access_token')
gh_access_token = request.cookies.get('gh_access_token')
fsq_access_token = request.cookies.get('fsq_access_token')