Python django.conf.settings 模块,GOOGLE_CLIENT_ID 实例源码

我们从Python开源项目中,提取了以下4个代码示例,用于说明如何使用django.conf.settings.GOOGLE_CLIENT_ID

项目:SpongeAuth    作者:lukegb    | 项目源码 | 文件源码
def _verify_google_id_token(request):
    if 'google_id_token' not in request.POST:
        raise crypt.AppIdentityError("google_id_token missing.")
    token = request.POST.get('google_id_token', None)

    idinfo = client.verify_id_token(token, django_settings.GOOGLE_CLIENT_ID)
    if idinfo['iss'] not in ['accounts.google.com', 'https://accounts.google.com']:
        raise crypt.AppIdentityError("Invalid issuer.")

    return token, idinfo
项目:fieldsight-kobocat    作者:awemulya    | 项目源码 | 文件源码
def get_refreshed_token(token):
    data = urllib.urlencode({
        'client_id': settings.GOOGLE_CLIENT_ID,
        'client_secret': settings.GOOGLE_CLIENT_SECRET,
        'refresh_token': token.refresh_token,
        'grant_type': 'refresh_token'})
    request = urllib2.Request(
        url='https://accounts.google.com/o/oauth2/token',
        data=data)
    request_open = urllib2.urlopen(request)
    response = request_open.read()
    request_open.close()
    tokens = json.loads(response)
    token.access_token = tokens['access_token']
    return token
项目:helios-server-mixnet    作者:RunasSudo    | 项目源码 | 文件源码
def get_flow(redirect_url=None):
  return OAuth2WebServerFlow(client_id=settings.GOOGLE_CLIENT_ID,
            client_secret=settings.GOOGLE_CLIENT_SECRET,
            scope='profile email',
            redirect_uri=redirect_url)
项目:FormShare    作者:qlands    | 项目源码 | 文件源码
def get_refreshed_token(token):
    data = urllib.urlencode({
        'client_id': settings.GOOGLE_CLIENT_ID,
        'client_secret': settings.GOOGLE_CLIENT_SECRET,
        'refresh_token': token.refresh_token,
        'grant_type': 'refresh_token'})
    request = urllib2.Request(
        url='https://accounts.google.com/o/oauth2/token',
        data=data)
    request_open = urllib2.urlopen(request)
    response = request_open.read()
    request_open.close()
    tokens = json.loads(response)
    token.access_token = tokens['access_token']
    return token