作者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/cn.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