使用以下代码,单击 google drive 的授权按钮后,我收到 404 resource not found 错误。我的代码在下面-任何想法我做错了什么?
from __future__ import print_function
import httplib2
import os
from apiclient import discovery
from oauth2client import client
from oauth2client import tools
from oauth2client.file import Storage
from apiclient.discovery import build
from google.appengine.ext import webapp
from oauth2client.appengine import OAuth2DecoratorFromClientSecrets
import webapp2
try:
import argparse
flags = argparse.ArgumentParser(parents=[tools.argparser]).parse_args()
except ImportError:
flags = None
except SystemExit:
flags= None
#
## If modifying these scopes, delete your previously saved credentials
## at ~/.credentials/drive-python-quickstart.json
SCOPES = 'https://www.googleapis.com/auth/drive'
CLIENT_SECRET_FILE = 'client_secret.json'
APPLICATION_NAME = 'Drive API Quickstart'
decorator = OAuth2DecoratorFromClientSecrets( CLIENT_SECRET_FILE,SCOPES)
service = build('drive', 'v3')
class MainHandler(webapp.RequestHandler):
@decorator.oauth_required
def get(self):
# Get the authorized Http object created by the decorator.
http = decorator.http()
# Call the service using the authorized Http object.
request = service.files().list(q = "mimeType != 'application/vnd.google-apps.folder'", pageSize=1000, )
response = request.execute(http=http)
app = webapp.WSGIApplication([
('/', MainHandler),
], debug=True)
我有https://drive-156701.appspot.com/oauth2callback结尾有和没有 / 作为重定向,我认为正确的重定向网址在哪里?谢谢!!