Skip to content

Commit

Permalink
Merge pull request #731 from haricot/fix_cache
Browse files Browse the repository at this point in the history
Fix redis compatibility pickle protocol version for py2
  • Loading branch information
jrief committed May 4, 2018
2 parents 563e707 + 2d354a9 commit b57b258
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions example/myshop/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@

from cmsplugin_cascade.utils import format_lazy

import six

SHOP_APP_LABEL = 'myshop'
BASE_DIR = os.path.dirname(__file__)

Expand Down Expand Up @@ -293,11 +295,20 @@
'prefix': 'session-{}'.format(SHOP_TUTORIAL),
'socket_timeout': 1
}
if six.PY3:
# Use the latest protocol version (default)
PICKLE_V=-1
else:
#py2 compatibility
PICKLE_V=2

CACHES = {
'default': {
'BACKEND': 'redis_cache.RedisCache',
'LOCATION': 'redis://{}:6379/1'.format(REDIS_HOST),
"OPTIONS": {
"PICKLE_VERSION": PICKLE_V,
}
},
'compressor': {
'BACKEND': 'redis_cache.RedisCache',
Expand Down

0 comments on commit b57b258

Please sign in to comment.