سؤال

I need to use memcached and file based cache. I setup my cache in settings:

CACHES = {
    'default': {
        'BACKEND': 'django.core.cache.backends.filebased.FileBasedCache',
        'LOCATION': 'c:/foo/bar',
    },
    'inmem': {
        'BACKEND': 'django.core.cache.backends.dummy.DummyCache',
    }
}

dummy is temporary. Docs says:

cache.set('my_key', 'hello, world!', 30)
cache.get('my_key')

OK, but how can I now set and get cache only for 'inmem' cache backend (in future memcached)? Documentation doesn't mention how to do that.

لا يوجد حل صحيح

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top