diff options
| author | Adam Chainz <adam@adamj.eu> | 2016-10-06 18:01:19 +0100 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2016-10-27 15:50:06 -0400 |
| commit | 3ea9e3baf93c8f436a7799e6899afc8525b6d94a (patch) | |
| tree | d8039c4eea737c045eaf42f728498739de75878f | |
| parent | 261c6c0447659fa67a7fa1e5b87adb491dc5ec77 (diff) | |
[1.10.x] Documented that cache keys are strings rather than bytes.
Backport of 968f61b99180a17e1752432df38f28f192c6cf86 from master
| -rw-r--r-- | docs/topics/cache.txt | 3 |
1 files changed, 3 insertions, 0 deletions
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 |
