Django-nonrel ≤1.3 and Memcache on Google App Engine
Asked Answered
Q

2

6

I'm a designer still trying to code up my first app in Google App Engine as an experiment.

I have got to the point where I want to set up memcache to cache my entire site following the instructions at: http://docs.djangoproject.com/en/dev/topics/cache/#memcached

I am clear that I need to add in my settings.py the following:

CACHE_BACKEND = 'memcached://[IP ADDRESS]:[PORT]/'

And then:

MIDDLEWARE_CLASSES = (
    'django.middleware.cache.UpdateCacheMiddleware',
    'django.middleware.common.CommonMiddleware',
    'django.middleware.cache.FetchFromCacheMiddleware',
)
CACHE_MIDDLEWARE_SECONDS=60*2

This might be a really dumb question but what would my IP address and port be for my google app engine site? Is there any considerations I need to make because of the fact that it is being hosted at Google?

How would I find it out

Querulous answered 24/10, 2010 at 23:9 Comment(1)
Since version 1.4 CACHE_BACKEND have been replaced with CACHESToyatoyama
S
4

djangoappengine has standard settings. At the top of your settings.py you should have "from djangoappengine.settings_base import *". You can take a look at the settings_base module to see all backends and default settings.

Subliminal answered 15/11, 2010 at 11:51 Comment(1)
Thanks for this Thomas. The above seems to have worked but should I add this import as well as CACHE_BACKEND = 'memcached://?timeout=0'?Querulous
C
1

Try: CACHE_BACKEND = 'memcached://?timeout=0'.

Source: http://bitbucket.org/wkornewald/djangoappengine/src/tip/settings_base.py

Costermonger answered 25/10, 2010 at 2:3 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.