Django アプリで Memcache を使用しようとしていますが、構成に何かが欠けているようです。どんな助けでも大歓迎です、ありがとう!
$ python manage.py shell
Python 2.7.1 (r271:86832, Jul 31 2011, 19:30:53)
[GCC 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)
>>> from django.core.cache import cache
>>> cache.set('my_key', 'hello, world!', 30)
>>> print cache.get('my_key')
None
>>>
設定.py
CACHES = {
'default': {
'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',
'LOCATION': '127.0.0.1:11211',
}
}
インストールされている API:
$ pypm install python-memcached
$ brew install memcached
$ brew install libmemcached