KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
Tools version: Python 2.6.5 Django 1.3.1 memcached 1.4.10 python-memcached 1.48 Memcached is currently running: $ ps -ef | grep memcache nobody 2993 1 0 16:46 ? 00:00:00 /usr/bin/memcached -m 64 -p 11211 -u nobody -l 127.0.0.1 I'm using memcached and python memcached with my Django proj and I've set it like the following in settings.py : CACHES = { 'default': { 'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache', 'LOCATION': '127.0.0.1:11211', 'TIMEOUT': 86400, }, } I've set the cache in the code: from django.core.cache import cache cache.set('countries', ['Canada', 'US']) I then open a Django shell to inspect the content of the cache: >>> from django.core.cache import cache >>> 'countries' in cache True >>> import memcache >>> mc = memcache.Client(['127.0.0.1:11211'], debug=1) >>> mc.get('countries') >>> When I use Django's cache, countries key exists. However, when I use Python's memcache, I don't get anything for countries. What am I doing wrong above?
Tags (comma-separated)
Save Edits
Cancel