In my settings.py I have:
CACHES = {
'default': {
'BACKEND': 'django.core.cache.backends.db.DatabaseCache',
'LOCATION': 'ws_cache_table',
'TIMEOUT': '3000000',
'OPTIONS': {
'MAX_ENTRIES': 10000000
}
}
}
But if I do this in python manage.py shell
:
from django.core.cache import cache
print type(cache)
I'm getting:
django.core.cache.backends.locmem.LocMemCache
Why!??? Now I can't clear my cache...
To prove my configuration is corect I can do:
from django.conf import settings
conf = settings.CACHES.get('default', None)
And I'm getting:
{'BACKEND': 'django.core.cache.backends.db.DatabaseCache',
'LOCATION': 'ws_cache_table',
'OPTIONS': {'MAX_ENTRIES': 10000000},
'TIMEOUT': '3000000'}
It looks like get_cache
method is called before CACHES is defined...