python - 无法从应用程序引擎访问 Google 电子表格 : "Moved Temporarily"?

标签 python google-app-engine

截至几天前,我能够访问我的 Google 电子表格 来自应用程序(在应用程序引擎中),但今天它被破坏了。

也就是说,我可以

name= "name of my spreadsheet"
self.client = gdata.spreadsheet.text_db.DatabaseClient()
self.client.GetDatabases(name=name)

并且成功了。事实上,当我运行时,这仍然有效 dev_应用程序服务器

但是,如果在应用程序引擎上崩溃。它说它无法解析 XML。

我在gdata代码中添加了一些打印,发现它不能 解析它,因为它认为的 XML 实际上只是以下的 HTML 登录页面。

现在发生的事情是 python gdata 库做了一个 (“eleanor”是电子表格名称)

GET /feeds/documents/private/full?title=eleanor

然后回来

<HTML>
<HEAD>
<TITLE>Moved Temporarily</TITLE>
</HEAD>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000">
<H1>Moved Temporarily</H1>
The document has moved <A HREF="https://www.google.com/accounts/
ServiceLogin?
service=writely&amp;passive=true&amp;nui=1&amp;continue=http%3A%2F
%2Fdocs.google.com%2Ffeeds%2Fdocuments%2Fprivate%2Ffull%3Ftitle
%3Deleanor&amp;followup=http%3A%2F%2Fdocs.google.com%2Ffeeds
%2Fdocuments%2Fprivate%2Ffull%3Ftitle%3Deleanor">here</A>.
</BODY>
</HTML>

但是,当在 dev_appserver.py 上本地运行时,相同的 GET 返回正确的 XML:

<?xml version='1.0' encoding='UTF-8'?><feed xmlns='http://www.w3.org/
2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/'
xmlns:docs='http://schemas.google.com/docs/2007' xmlns:batch='http://
schemas.google.com/gdata/batch' xmlns:gd='http://schemas.google.com/g/
2005'><id>http://docs.google.com/feeds/documents/private/full</
id><updated>2009-10-29T19:14:07.401Z</updated><category scheme=......

我仔细检查了,是的,我的应用程序被授权访问谷歌 文档。

那么,“暂时移动”是怎么回事?这是 googleplex 的暂时性问题,还是身份验证问题?

最佳答案

Docs 正在将您重定向到登录页面。在尝试获取电子表格之前,您需要进行身份验证。不过,我不确定为什么它不要求您在开发服务器上进行身份验证。

关于python - 无法从应用程序引擎访问 Google 电子表格 : "Moved Temporarily"?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1646073/

相关文章:

google-app-engine - 在 Google 应用引擎中提供 .java Servlet 文件作为欢迎文件

java - Google 帐户凭据更改帐户/注销

google-app-engine - Polymer Dart-Google App引擎TemplateSyntaxError

python - 线程中的 pyGame

Python 子进程 - 在创建的新命令提示符中运行第二个命令

python - 是否有用于轻松编写可缩放 UI 的 Python 库?

python - 在 Google App Engine 上更新数据存储区中的大量实体

python - ElementTree 和 unicode

python - PowerShell中的virtualenv?

python - 无法在 python shell 中导入 GAE api