I would like to store both session data and cached data in memcache when I
upload my app to GAE. Can anybody point me in the right direction for
setting this up?
Based on the web2py scaffolding app I have tried (in models/db.py):
if not request.env.web2py_runtime_gae:
db = DAL('sqlite://storage.sqlite', lazy_tables=True)
else:
db = DAL('google:datastore', lazy_tables=True)
from gluon.contrib.memdb import MEMDB
from google.appengine.api.memcache import Client
session.connect(request, response, db = MEMDB(Client()))
cache.ram = cache.disk = cache.memcache
My app runs OK on sqlite but, once moved to GAE I get an Internal Error
whenever serving a page that attempts to store cache data in memcache.
>From http://web2py.com/books/default/chapter/29/13?search=cache#Memcache I
see there is a suggestion to use:
from gluon.contrib.gae_memcache import MemcacheClient
from gluon.contrib.memdb import MEMDB
cache.memcache = MemcacheClient(request)
I don't understand how this relates to the scaffolding app code - what is
MEMDB, what is the correct usage of gluon.contrib.gae_memcache
and google.appengine.api.memcache?
Trial and error has got me nowhere, so I thought I would confess my
ignorance and ask the experts!
Andy
--
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.