如何在Google Cloud AppEngine上为Django配置Memcache? [英] How to configure Memcache for Django on Google cloud AppEngine?
问题描述
在我的设置中,我有:
CACHES = {
'default': {
'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',
'LOCATION': '127.0.0.1:11211',
}
}
并且我已经安装了 https://pypi.org/project/python-memcached/
还有什么需要的吗?
推荐答案
在GCP上为Django启用Memcache的方式取决于您所使用的产品(App Engine,Compute Engine,Kubernetes Engine)[1]
The way to enable Memcache for Django on GCP depends on which product you are using (App Engine, Compute Engine, Kubernetes Engine) [1]
由于您正在使用App Engine,因此它是内置的.您可以在此处找到有关如何将Memcache与GCP结合使用的示例.[2]
Since you are using App Engine, it is built-in. You can find examples on how to use Memcache with GCP here. [2]
[1]如何在适用于Django的GCP上安装Memcache: https://cloud.google.com/python/django/#caches
[1] How to install Memcache on GCP for Django: https://cloud.google.com/python/django/#caches
[2] GCP文档上的Memcache示例: https://cloud.google.com/appengine/docs/standard/python/memcache/examples?hl = zh-CN
[2]Memcache examples on GCP Docs: https://cloud.google.com/appengine/docs/standard/python/memcache/examples?hl=en
这篇关于如何在Google Cloud AppEngine上为Django配置Memcache?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!