gdata 电子表格上的授权错误
Authorization error on gdata Spreadsheet
使用 gdata 在我的驱动器上使用 python 在 appengine 上更新电子表格文件。一切正常,直到最近,代码开始遇到错误。
import webapp2
import gdata.spreadsheet.text_db
from google.appengine.api import mail
client = gdata.spreadsheet.text_db.DatabaseClient(username='mail@gmail.com', password='passsword')
class createSurvey(webapp2.RequestHandler):
def get(self):
db = client.CreateDatabase("Project")// this line started to show the error below.
.
Traceback (most recent call last):
File "<pyshell#3>", line 1, in <module>
db = client.CreateDatabase("Project")
File "C:\Python27\lib\gdata\spreadsheet\text_db.py", line 146, in CreateDatabase
db_entry = self.__docs_client.UploadSpreadsheet(virtual_media_source, name)
File "C:\Python27\lib\atom\__init__.py", line 1475, in deprecated_function
return f(*args, **kwargs)
File "C:\Python27\lib\gdata\docs\service.py", line 466, in UploadSpreadsheet
folder_or_uri=folder_or_uri)
File "C:\Python27\lib\gdata\docs\service.py", line 161, in _UploadFile
converter=gdata.docs.DocumentListEntryFromString)
File "C:\Python27\lib\gdata\service.py", line 1236, in Post
media_source=media_source, converter=converter)
File "C:\Python27\lib\gdata\service.py", line 1358, in PostOrPut
'reason': server_response.reason, 'body': result_body}
RequestError: {'status': 401, 'body': '<HTML>\n<HEAD>\n<TITLE>Authorization required</TITLE>\n</HEAD>\n<BODY BGCOLOR="#FFFFFF" TEXT="#000000">\n<H1>Authorization required</H1>\n<H2>Error 401</H2>\n</BODY>\n</HTML>\n', 'reason': 'Authorization required'}
一开始以为是文件限制,打开了还是不行。我怎样才能解决这个问题 。
Google 停止允许这种身份验证方法。开发人员必须在 google 控制台上创建凭据。 see this for more help and if you are using Google Data Protocol for to access help use spreadsheet as db like i was trying to do, This 应该也有帮助。
使用 gdata 在我的驱动器上使用 python 在 appengine 上更新电子表格文件。一切正常,直到最近,代码开始遇到错误。
import webapp2
import gdata.spreadsheet.text_db
from google.appengine.api import mail
client = gdata.spreadsheet.text_db.DatabaseClient(username='mail@gmail.com', password='passsword')
class createSurvey(webapp2.RequestHandler):
def get(self):
db = client.CreateDatabase("Project")// this line started to show the error below.
.
Traceback (most recent call last):
File "<pyshell#3>", line 1, in <module>
db = client.CreateDatabase("Project")
File "C:\Python27\lib\gdata\spreadsheet\text_db.py", line 146, in CreateDatabase
db_entry = self.__docs_client.UploadSpreadsheet(virtual_media_source, name)
File "C:\Python27\lib\atom\__init__.py", line 1475, in deprecated_function
return f(*args, **kwargs)
File "C:\Python27\lib\gdata\docs\service.py", line 466, in UploadSpreadsheet
folder_or_uri=folder_or_uri)
File "C:\Python27\lib\gdata\docs\service.py", line 161, in _UploadFile
converter=gdata.docs.DocumentListEntryFromString)
File "C:\Python27\lib\gdata\service.py", line 1236, in Post
media_source=media_source, converter=converter)
File "C:\Python27\lib\gdata\service.py", line 1358, in PostOrPut
'reason': server_response.reason, 'body': result_body}
RequestError: {'status': 401, 'body': '<HTML>\n<HEAD>\n<TITLE>Authorization required</TITLE>\n</HEAD>\n<BODY BGCOLOR="#FFFFFF" TEXT="#000000">\n<H1>Authorization required</H1>\n<H2>Error 401</H2>\n</BODY>\n</HTML>\n', 'reason': 'Authorization required'}
一开始以为是文件限制,打开了还是不行。我怎样才能解决这个问题 。
Google 停止允许这种身份验证方法。开发人员必须在 google 控制台上创建凭据。 see this for more help and if you are using Google Data Protocol for to access help use spreadsheet as db like i was trying to do, This 应该也有帮助。