(request)
return flow
Prepare an OAuth 2.0 flow

    https://developers.google.com/api-client-library/python/guide/aaa_oauth
Prepare an OAuth 2.0 flow
Prepare an OAuth 2 . 0 flow
def get_google_oauth_flow(request):
    """Prepare an OAuth 2.0 flow

    https://developers.google.com/api-client-library/python/guide/aaa_oauth"""

    from oauth2client.client import OAuth2WebServerFlow

    site = RequestSite(request)

    callback = "http{s}://{domain}{callback}".format(
        s="s" if request.is_secure() else "",
        domain=site.domain,
        callback=reverse("login-google-callback"),
    )

    flow = OAuth2WebServerFlow(
        client_id=settings.GOOGLE_CLIENT_ID,
        client_secret=settings.GOOGLE_CLIENT_SECRET,
        scope="https://www.googleapis.com/auth/userinfo.email",
        redirect_uri=callback,
    )

    return flow
def get_google_oauth_flow ( request ) : from oauth2client . client import OAuth2WebServerFlow site = RequestSite ( request ) callback = "http{s}://{domain}{callback}" . format ( s = "s" if request . is_secure ( ) else "" , domain = site . domain , callback = reverse ( "login-google-callback" ) , ) flow = OAuth2WebServerFlow ( client_id = settings . GOOGLE_CLIENT_ID , client_secret = settings . GOOGLE_CLIENT_SECRET , scope = "https://www.googleapis.com/auth/userinfo.email" , redirect_uri = callback , ) return flow