Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
D
django
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
django
Commits
2315f1a2
Kaydet (Commit)
2315f1a2
authored
Eyl 20, 2012
tarafından
Ian Clelland
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Add documentation for get_caches function
üst
89136b27
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
1 deletion
+16
-1
cache.txt
docs/topics/cache.txt
+16
-1
No files found.
docs/topics/cache.txt
Dosyayı görüntüle @
2315f1a2
...
...
@@ -673,12 +673,27 @@ dictionaries, lists of model objects, and so forth. (Most common Python objects
can be pickled; refer to the Python documentation for more information about
pickling.)
Accessing the cache
-------------------
The cache module, ``django.core.cache``, has a ``cache`` object that's
automatically created from the ``'default'`` entry in the :setting:`CACHES`
setting::
>>> from django.core.cache import cache
If you have multiple caches defined in :setting:`CACHES`, then you can use
:func:`django.core.cache.get_cache` to retrieve a cache object for any key::
>>> from django.core.cache import get_cache
>>> cache = get_cache('alternate')
If the named key does not exist, :exc:`InvalidCacheBackendError` will be raised.
Basic usage
-----------
The basic interface is ``set(key, value, timeout)`` and ``get(key)``::
>>> cache.set('my_key', 'hello, world!', 30)
...
...
@@ -686,7 +701,7 @@ The basic interface is ``set(key, value, timeout)`` and ``get(key)``::
'hello, world!'
The ``timeout`` argument is optional and defaults to the ``timeout``
argument of the
``'default'`` backend in
:setting:`CACHES` setting
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.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment