Answer the question
In order to leave comments, you need to log in
Why doesn't memcached save the cache?
Learn caching.
Installed memcached
pip install python-memcached
Enabled caching
CACHES = {
'default' : {
'BACKEND' : 'django.core.cache.backends.memcached.MemcachedCache' ,
'LOCATION' : '127.0.0.1:11211' ,
}
}
from django.core.cache import cache
def user_sitebar(request):
cache.set('my_key', 'hello, world!', 30)
print(cache.get('my_key'))
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question