Django Memcache: solishtiring va o'rnatish

Bu erda Django guruhlarida Tom Evanz usulni tushuntirib beradi Bu erda solishtirish va o'rnatish ni Django-da quyida ko'rsatilganidek amalga oshiring

You can access the memcached client via django though: 
>>> from django.core import cache 
>>> c=cache.get_cache('default') 
>>> help(c._client.cas) 

Lekin qandaydir ish bilan shug'ullana olmadim.

>>> from django.core import cache
>>> c=cache.get_cache('memcache')
>>> help(c._client.cas)
Traceback (most recent call last):
  File "", line 1, in 
AttributeError: 'MemcachedCache' object has no attribute '_client'

Yuqorida ko'rsatilgan usul bo'lmasa, qanday qilib Django bilan solishtirish va sozlash mumkin?

Django 1.3 versiyasidan foydalanaman.

2

1 javoblar

manba kodini ko'rib chiqqandan keyin! Buni BaseMemcachedCache da topaman:

@property
def _cache(self):
    """
    Implements transparent thread-safe access to a memcached client.
    """
    if getattr(self, '_client', None) is None:
        self._client = self._lib.Client(self._servers)

    return self._client

Shunday qilib, aytaman, bu ishlaydi:

c._cache.cas

Ushlab ko'ring va menga xabar bering!

for more details: https://code.djangoproject.com/svn/django/trunk/django/core/cache/backends/memcached.py

3
qo'shib qo'ydi
Python
Python
372 ishtirokchilar

Bu guruh python dasturlash tilini muhokama qilish uchun. Iltimos, o'zingizni hurmat qiling va faqat dasturlash bo'yicha yozing. Botlar mavzusini @botlarhaqida guruhida muhokama qling! FAQ: @PyFAQ Offtopic: @python_uz_offtopic

Python offtopic group !
Python offtopic group !
150 ishtirokchilar

@python_uz gruppasining offtop gruppasi. offtop bo'lsa ham reklama mumkin emas ) Boshqa dasturlash tiliga oid gruppalar @languages_programming