Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

[1.5.x] Tweaked cache key creation to avoid strict typing.

This is a provisional change. See #19221 for details.

Backport of 6c69de8 from master.
  • Loading branch information...
commit 3db2aeec988f7bc9ad8a0844809a5bd4d7211669 1 parent 825a793
@aaugustin aaugustin authored
Showing with 2 additions and 1 deletion.
  1. +2 −1  django/core/cache/backends/base.py
View
3  django/core/cache/backends/base.py
@@ -12,6 +12,7 @@ class InvalidCacheBackendError(ImproperlyConfigured):
class CacheKeyWarning(DjangoRuntimeWarning):
pass
+
# Memcached does not accept keys longer than this.
MEMCACHE_MAX_KEY_LENGTH = 250
@@ -23,7 +24,7 @@ def default_key_func(key, key_prefix, version):
the `key_prefix'. KEY_FUNCTION can be used to specify an alternate
function with custom key making behavior.
"""
- return ':'.join([key_prefix, str(version), key])
+ return '%s:%s:%s' % (key_prefix, version, key)
def get_key_func(key_func):
"""
Please sign in to comment.
Something went wrong with that request. Please try again.