skip to Main Content

Memcached – Removing control/space characters from cache key in python

I have to remove control/space characters from my cache key. It is giving following error: MemcachedKeyCharacterError: Control/space characters not allowed (key=' :1 :ZjE3MDJiNDY4NjI3OGJlY2ZmYzg4YmFhYmU2ZjRiN2E4MzU1NTMyYw==n') The code which I am using is: class CachedAPIView(APIView): def get_object(self,request): s = hashlib.sha1() s.update('Messages') returnData=cache.get(base64.encodestring(s.hexdigest()),None) if…

VIEW QUESTION
Back To Top
Search