I am working with using memcached with Django, and a problem came up.

I have memcached running, and using the
django.middleware.cache.CacheMiddleware to cache my entire site seems
to be working. But when I try to use the low-level api Django way for
caching ( 
http://www.djangoproject.com/documentation/cache/#the-low-level-cache-api
)...
from django.core.cache import cache

if cache.get('temp') == None:
    cache.set('temp', 'hello world')
    return HttpResponse('cache failed to load:
'+str(cache.get('temp')))
else:
    return HttpResponse('cache loaded fine: '+str(cache.get('temp')))

...nothing ever seems to get set in the cache. The cache middleware
does the same thing though, so how is it that it seems to work, and my
view doesn't? Also, is there a way to see the stats of memcached? I
know the stat command exists, but I have no idea how to use it to
display the hits, misses, usage, etc. using either memcached from the
command line, or the cmemcache library.

Effbot apparently has a stats view ( 
http://effbot.org/zone/django-memcached-view.htm
) that uses python-memcache, and I am using cmemcache, and I am not
sure how to translate the code from the python-memcache to cmemcache.
Basically because I haven't been able to find any documentation, or
examples of how to use cmemcache.

Any help would be greatly appreciated.

Thanks,
Brandon
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to