mirror of
https://github.com/django/django.git
synced 2025-06-05 03:29:12 +00:00
[1.10.x] Documented that cache keys are strings rather than bytes.
Backport of 968f61b99180a17e1752432df38f28f192c6cf86 from master
This commit is contained in:
parent
261c6c0447
commit
3ea9e3baf9
@ -757,6 +757,9 @@ The basic interface is ``set(key, value, timeout)`` and ``get(key)``::
|
|||||||
>>> cache.get('my_key')
|
>>> cache.get('my_key')
|
||||||
'hello, world!'
|
'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
|
The ``timeout`` argument is optional and defaults to the ``timeout`` argument
|
||||||
of the appropriate backend in the :setting:`CACHES` setting (explained above).
|
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
|
It's the number of seconds the value should be stored in the cache. Passing in
|
||||||
|
Loading…
x
Reference in New Issue
Block a user