[Django]-Django cache.set() Type error

4👍

The error comes from string/unicode changes in Python 3. In Python 2, string type are bytes, but in Python 3 string type is separate from byte type – which is causing the error you’re seeing.

If you’re using Python 3.x with memcached, use the python3-memcached package. It’s a drop in replacement for python-memcached.

pip install python3-memcached

Leave a comment