如何在Google AppEngine Python37中获取凭据

发布于 2021-01-29 15:04:59

我在AppEngine Python3.7标准版中启动了新应用。

我正在尝试使用以下代码段获取凭据,但失败了。

任何人都可以使用credentialsGAE标准Python37吗?

输入:

from google.auth import app_engine
credentials = app_engine.Credentials()

输出:

The App Engine APIs are not available
关注者
0
被浏览
92
1 个回答
  • 面试哥
    面试哥 2021-01-29
    为面试而生,有面试问题,就找面试哥。

    将App Engine Standard与python
    3.7结合使用时,没有google.xxx库可用。您必须构建自己的数据库或使用标准的Python库。这同样适用于:authusersimagessearchmailtaskqueuememcacheurlfetchdeferred,等等,甚至在ndb数据存储接口。

    对于数据存储,您使用google-cloud-datastore或第三方。

    对于其他人,则使用标准的Python库,例如:google.auth=> rauthgoogle.appengine.api.memcache
    =>python-memcached

    在此处了解更多信息:https : //cloud.google.com/appengine/docs/standard/python3/python-
    differences

    该页面建议使用Google Identity Platform或Firebase身份验证进行授权。



知识点
面圈网VIP题库

面圈网VIP题库全新上线,海量真题题库资源。 90大类考试,超10万份考试真题开放下载啦

去下载看看