I am unable to logout the user in admin panel of Django. The logout task is not perform after using memcached code in Django settings file. It shows an error like:
‘AttributeError at /admin/logout/’
and
‘Client’ object has no attribute ‘_deletetouch’.
The memcached code in settings.py as:
enter code here
SESSION_ENGINE='django.contrib.sessions.backends.cache'
CACHES = {
'default': {
'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',
'LOCATION': '127.0.0.1:11211',
}
}
2
Answers
I ran into this recently and found that I had python3-memcached installed (which is deprecated), and needed python-memcached instead. The reason it showed recently is because django 3.1 has a change which calls an undocumented method in memcached – questionable decision – but it works fine with the regular memcached versions.
In case anyone got stock in this again, I’ve tested recent versions of python-memcached, found recently updated versions, which is 1.60 and 1.61 would cause this. So I rolled back to 1.59 and solve the problem.