from django.core.cache import cache
def testcache():
cache.set( test , I am putting this message in ,3333)
print cache.get( test )
它只是印刷品“None”。
这是“可能的补充”:
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
这也是我的背景。 py:
CACHE_BACKEND = memcached://MYIPADRESS:11211/
顺便说一句,它过去曾工作,但现在却不远! 我不知道为什么。 So weird.