From 7b010997e7dac5b91cac507f3bc696ab4e9e46f9 Mon Sep 17 00:00:00 2001 From: Adam DePue Date: Wed, 5 Apr 2017 22:22:26 +0000 Subject: [PATCH] Support pylibmc behaviors subdict in Django 1.11 --- django_elasticache/memcached.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/django_elasticache/memcached.py b/django_elasticache/memcached.py index f7c19fc..dfbfd9d 100644 --- a/django_elasticache/memcached.py +++ b/django_elasticache/memcached.py @@ -94,7 +94,10 @@ def _cache(self): client = self._lib.Client(self.get_cluster_nodes()) if self._options: - client.behaviors = self._options + # In Django 1.11, all behaviors are shifted into a behaviors dict + # Attempt to get from there, and fall back to old behavior if the behaviors + # key does not exist + client.behaviors = self._options.get('behaviors', self._options) container._client = client