簡體   English   中英

如何在Google AppEngine Python37中獲取憑據

[英]How to get credentials in Google AppEngine Python37

我在AppEngine Python3.7 stadard中開始了新的應用程序。

我正在嘗試使用以下代碼段獲取憑據,但它失敗了。

有人能夠獲得GAE標准Python37的credentials嗎?

輸入:

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

輸出:

The App Engine APIs are not available

使用帶有python 3.7的App Engine Standard時,沒有任何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身份驗證進行授權。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM