如何在Google AppEngine Python37中获取凭据 [英] How to get credentials in Google AppEngine Python37

查看:41
本文介绍了如何在Google AppEngine Python37中获取凭据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I started new app in AppEngine Python3.7 stadard.

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

I am trying to get credentials using the following snippet, but its failing.

任何人都可以在GAE标准Python37中获得credentials吗?

Anybody able to get credentials in GAE standard Python37 ?

输入:

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

输出:

The App Engine APIs are not available

推荐答案

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

When using App Engine Standard with python 3.7, none of the google.xxx libraries are available. You have to build your own, or use standard Python libraries. This goes for: auth, users, images, search, mail, taskqueue, memcache, urlfetch, deferred, etc., and even the ndb datastore interface.

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

For datastore, you use google-cloud-datastore or some 3rd party.

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

For others, you use a standard Python library, e.g.: google.auth => rauth, google.appengine.api.memcache => python-memcached

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

Read more here: https://cloud.google.com/appengine/docs/standard/python3/python-differences

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

That page recommends Google Identity Platform or Firebase Authentication to do authorization.

这篇关于如何在Google AppEngine Python37中获取凭据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆