I am new to Django and caching and is using Django 1.6.
I followed the instructions on django-cache-machine' page to install it.
1.pip install django-cache-machine
2.Add following to settings.py
CACHES = {
'default': {
'BACKEND': 'caching.backends.memcached.MemcachedCache',
'LOCATION': 'localhost:11211',
'PREFIX': 'wee:',
},
}
3.Apply the changes on one of my models just as the minimal case in the instructions.
When I try to run server, it shows the following errors.
django.core.cache.backends.base.InvalidCacheBackendError: Could not find backend 'caching.backends.memcached.MemcachedCache': 'module' object has no attribute ' CacheClass'
I previously installed johnny-cache but quickly removed it and then installed cache machine. I dont know if it is relevent. Memcached is also running.
Thanks in advance!
EDIT:
Just found that it is already mentioned in one issue in the Github page of the app. https://github.com/jbalogh/django-cache-machine/issues/44
And a fix is pulled in. So I reinstall the github version.
pip install -e git://github.com/jbalogh/django-cache-machine.git#egg=django-cache-machine
Now it shows another error.
ImportError: No module named memcache
So I install another app called python-memcached. The server runs but no caching occurs.
I run python shell and the app works fine. So I think the problem is still django-cache-machine.
I guess django-cache-machine just not yet fully support Django 1.6.
If anyone knows how to get it work on Django 1.6+Python 2.7, please let me know.
Thanks again!