From 3ea9e3baf93c8f436a7799e6899afc8525b6d94a Mon Sep 17 00:00:00 2001 From: Adam Chainz Date: Thu, 6 Oct 2016 18:01:19 +0100 Subject: [PATCH] [1.10.x] Documented that cache keys are strings rather than bytes. Backport of 968f61b99180a17e1752432df38f28f192c6cf86 from master --- docs/topics/cache.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/topics/cache.txt b/docs/topics/cache.txt index 6f6fce0a71..12f27c2db6 100644 --- a/docs/topics/cache.txt +++ b/docs/topics/cache.txt @@ -757,6 +757,9 @@ The basic interface is ``set(key, value, timeout)`` and ``get(key)``:: >>> cache.get('my_key') 'hello, world!' +``key`` should be a ``str`` (or ``unicode`` on Python 2), and ``value`` can be +any picklable Python object. + The ``timeout`` argument is optional and defaults to the ``timeout`` argument of the appropriate backend in the :setting:`CACHES` setting (explained above). It's the number of seconds the value should be stored in the cache. Passing in