In Django, how to clear all the memcached keys and values?

TIMEX picture TIMEX · Oct 25, 2009 · Viewed 11.6k times · Source

I don't want to restart the memcached server!

Answer

shanyu picture shanyu · Oct 25, 2009
from django.core.cache import cache
cache._cache.flush_all()

Also see this ticket, it has a patch (that I haven't tested) to flush any type of cache backend: http://code.djangoproject.com/ticket/11503