[問題] GCP 上 django 如何用 memcache

看板Python作者 (123)時間5年前 (2019/08/17 20:19), 5年前編輯推噓0(0015)
留言15則, 1人參與, 5年前最新討論串1/1
請問在 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://www.ptt.cc/bbs/Python/M.1566044351.A.E20.html

08/18 13:06, 5年前 , 1F
我研究了一把。App Engine 隨附內建 Memcached 服務。如
08/18 13:06, 1F

08/18 13:06, 5年前 , 2F
果你在本機上可以,有個步驟 https://cloud.google.com/
08/18 13:06, 2F

08/18 13:06, 5年前 , 3F
python/django/appengine 讓你將你的環境移至 gcp 不知
08/18 13:06, 3F

08/18 13:06, 5年前 , 4F
你試了嗎?至於 requirement,看範例上很單純 https://
08/18 13:06, 4F

08/18 13:06, 5年前 , 5F
github.com/GoogleCloudPlatform/python-docs-samples/b
08/18 13:06, 5F

08/18 13:06, 5年前 , 6F
lob/master/appengine/standard/django/requirements.tx
08/18 13:06, 6F

08/18 13:06, 5年前 , 7F
t
08/18 13:06, 7F

08/18 13:07, 5年前 , 8F
本想幫你試一把,但這環境相依性太高。太花時間了。請自
08/18 13:07, 8F

08/18 13:07, 5年前 , 9F
己加油。
08/18 13:07, 9F

08/18 13:15, 5年前 , 10F
感覺上它是個托管的docker環境,你就是把你在本機上的東
08/18 13:15, 10F

08/18 13:15, 5年前 , 11F
西移值過去。然後不知道你本來用什麼DB,它用的是cloudD
08/18 13:15, 11F

08/18 13:15, 5年前 , 12F
B。我光裝本機相應的Sdk就快一小時去了。
08/18 13:15, 12F
先感謝花時間測試 那你有成功嗎? 因為我要架 web,需要 memcache,GCP 上只限定用 google 的 ※ 編輯: f496328mm (118.233.85.190 臺灣), 08/18/2019 13:38:14

08/18 17:57, 5年前 , 13F
很可惜我手上沒有Django然後還要用DB做memcache的東西來
08/18 17:57, 13F

08/18 17:57, 5年前 , 14F
試,所以我說這東西環境相依性高。要不你po你的code我來
08/18 17:57, 14F

08/18 17:57, 5年前 , 15F
試看看
08/18 17:57, 15F
文章代碼(AID): #1TL_2_uW (Python)
文章代碼(AID): #1TL_2_uW (Python)