sebleier/django-redis-cache — Issue #33: Getting InvalidCacheBackendError
Author: tijs
Created: 2012-03-09 12:49:52+00:00
State: open

I have a new project where is installed redis-cache from scratch using pip, so i have version 0.9.2. my redis-py install is also fresh; 2.4.11, django is 1.3.1. I have setup Redis cache as follows:

INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.admin',
'django.contrib.admindocs',

# tools
'south',
'epio_commands',
'raven.contrib.django',
'debug_toolbar',
'redis_cache',
'feincms',
'feincms.module.page',
'feincms.module.medialibrary',

# main app
'core',
)

CACHES = {
'default': {
'BACKEND': 'redis_cache.RedisCache',
'LOCATION': '{host}:{port}'.format(
host=config['redis']['host'],
port=int(config['redis']['port'])
),
'OPTIONS': {
'PASSWORD': config['redis']['password'],
'MAX_ENTRIES': 10000
},
'VERSION': config['core']['version'],
'TIMEOUT': 3600*8 # 8 hours
},
}

The weird thing is that while this setup works perfectly in other projects in this project i get the following error:

File "/Users/tijs/.virtualenvs/swov/lib/python2.7/site-packages/django/core/cache/__init__.py", line 179, in get_cache
"Could not find backend '%s': %s" % (backend, e))
django.core.cache.backends.base.InvalidCacheBackendError: Could not find backend 'redis_cache.RedisCache': 'module' object has no attribute 'RedisCache'

The full stacktrace is here: http://pastebin.com/butH6Jup