Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.
from django.core.cache import cache
    def testcache():
        cache.set('test','I am putting this message in',3333)
        print cache.get('test')

It just prints "None"

This is in "ps aux":

dovr      2241  0.0  0.8  57824  2144 ?        Ssl  04:20   0:00 memcached -d -u root -m 3900 -p 11211
dovr      2247  0.0  3.7  83696  9800 pts/2    S+   04:20   0:00 python manage.py runserver 0.0.0.0:8000

And this is in my settings.py:

CACHE_BACKEND = 'memcached://MYIPADRESS:11211/'

By the way, it worked before, but not anymore! I don't know why. So weird.

share|improve this question

1 Answer 1

up vote 1 down vote accepted

Some questions:

  • Is your memcache server configured to listen on your public ip address or does it only listen on localhost?
  • Is MYIPADDRESS local or public?

In case MYIPADDRESS is a public one and your server only listens on 127.0.0.1 this doesn't work. You'd need to make your server listen on 0.0.0.0 to listen on all interfaces.

More questions:

  • How did you install memcached? Which OS / distro?
  • What's the memcache library you're using? memcache? cmemcached? cmemcache? pylibmc? There are many out there...
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.