我正在一个系统中工作,在该系统中,多个代码库访问同一个 redis 实例,因此在 django 框架中读取从其他代码库写入的一些数据时,我收到以下错误。
Traceback (most recent call last):
File "<console>", line 1, in <module>
File "/usr/local/lib/python3.5/dist-packages/django_redis/cache.py", line 32, in _decorator
return method(self, *args, **kwargs)
File "/usr/local/lib/python3.5/dist-packages/django_redis/cache.py", line 81, in get
client=client)
File "/usr/local/lib/python3.5/dist-packages/django_redis/client/default.py", line 210, in get
return self.decode(value)
File "/usr/local/lib/python3.5/dist-packages/django_redis/client/default.py", line 318, in decode
value = self._serializer.loads(value)
File "/usr/local/lib/python3.5/dist-packages/django_redis/serializers/pickle.py", line 35, in loads
return pickle.loads(value)
_pickle.UnpicklingError: invalid load key, '{'.
基本上 Django 试图反序列化(unpickle)数据,尽管数据甚至没有序列化(pickeled)。我可以在 django-redis 中关闭这个酸洗和取消酸洗吗