作者f496328mm (123)
看板Python
標題[問題] GCP 上 django 如何用 memcache
時間Sat Aug 17 20:19:07 2019
請問在 GCP 上的 App Engine ,使用 django 架站,要使用 memcache,
requirements.txt 需要加入哪個 package?
from google.appengine.api import memcache
這行一直出錯,local 端可以下載 google-cloud-sdk 去 call 裡面的 package,但是
在 GCP 要如何做? 感謝
有參考這篇
https://github.com/GoogleCloudPlatform/getting-started-python/issues/94
在我的 requirements.txt 加入
google-cloud==0.19.0
gunicorn==19.6.0
oauth2client==3.0.0
googleapis-common-protos==1.3.5
還是不行
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 118.233.85.190 (臺灣)
※ 文章網址: https://webptt.com/m.aspx?n=bbs/Python/M.1566044351.A.E20.html
1F:→ alvinlin: 我研究了一把。App Engine 隨附內建 Memcached 服務。如 08/18 13:06
3F:→ alvinlin: python/django/appengine 讓你將你的環境移至 gcp 不知 08/18 13:06
4F:→ alvinlin: 你試了嗎?至於 requirement,看範例上很單純 https:// 08/18 13:06
5F:→ alvinlin: github.com/GoogleCloudPlatform/python-docs-samples/b 08/18 13:06
6F:→ alvinlin: lob/master/appengine/standard/django/requirements.tx 08/18 13:06
7F:→ alvinlin: t 08/18 13:06
8F:→ alvinlin: 本想幫你試一把,但這環境相依性太高。太花時間了。請自 08/18 13:07
9F:→ alvinlin: 己加油。 08/18 13:07
10F:→ alvinlin: 感覺上它是個托管的docker環境,你就是把你在本機上的東 08/18 13:15
11F:→ alvinlin: 西移值過去。然後不知道你本來用什麼DB,它用的是cloudD 08/18 13:15
12F:→ alvinlin: B。我光裝本機相應的Sdk就快一小時去了。 08/18 13:15
先感謝花時間測試
那你有成功嗎?
因為我要架 web,需要 memcache,GCP 上只限定用 google 的
※ 編輯: f496328mm (118.233.85.190 臺灣), 08/18/2019 13:38:14
13F:→ alvinlin: 很可惜我手上沒有Django然後還要用DB做memcache的東西來 08/18 17:57
14F:→ alvinlin: 試,所以我說這東西環境相依性高。要不你po你的code我來 08/18 17:57
15F:→ alvinlin: 試看看 08/18 17:57