2
我想在我的開發機器上設置約翰尼緩存,但我遇到了一些問題。使用基於文件的緩存是這樣的:配置約翰尼緩存
CACHES = {
'default' : dict(
BACKEND= 'johnny.backends.filebased.FileBasedCache',
LOCATION= '/tmp',
)
}
MIDDLEWARE_CLASSES = (
'johnny.middleware.LocalStoreClearMiddleware',
'johnny.middleware.QueryCacheMiddleware',
)
我得到:
Traceback (most recent call last):
File "/Users/kitsunde/.virtualenvs/media-pop/lib/python2.7/site-packages/django/core/servers/basehttp.py", line 283, in run
self.result = application(self.environ, self.start_response)
File "/Users/kitsunde/.virtualenvs/media-pop/lib/python2.7/site-packages/django/contrib/staticfiles/handlers.py", line 68, in __call__
return self.application(environ, start_response)
File "/Users/kitsunde/.virtualenvs/media-pop/lib/python2.7/site-packages/django/core/handlers/wsgi.py", line 273, in __call__
response = self.get_response(request)
File "/Users/kitsunde/.virtualenvs/media-pop/lib/python2.7/site-packages/django/core/handlers/base.py", line 168, in get_response
receivers = signals.got_request_exception.send(sender=self.__class__, request=request)
File "/Users/kitsunde/.virtualenvs/media-pop/lib/python2.7/site-packages/django/dispatch/dispatcher.py", line 172, in send
response = receiver(signal=self, sender=sender, **named)
File "/Users/kitsunde/.virtualenvs/media-pop/lib/python2.7/site-packages/django/db/transaction.py", line 222, in inner
self.__exit__(None, None, None)
File "/Users/kitsunde/.virtualenvs/media-pop/lib/python2.7/site-packages/django/db/transaction.py", line 207, in __exit__
self.exiting(exc_value, self.using)
File "/Users/kitsunde/.virtualenvs/media-pop/lib/python2.7/site-packages/django/db/transaction.py", line 281, in exiting
commit(using=using)
File "/Users/kitsunde/.virtualenvs/media-pop/lib/python2.7/site-packages/johnny/transaction.py", line 147, in newfun
self._flush(commit=commit, using=using)
File "/Users/kitsunde/.virtualenvs/media-pop/lib/python2.7/site-packages/johnny/transaction.py", line 135, in _flush
self.cache_backend.set(key, value, self.timeout)
File "/Users/kitsunde/.virtualenvs/media-pop/lib/python2.7/site-packages/johnny/backends/filebased.py", line 23, in set
return super(CacheClass, self).set(key, value, timeout=timeout, **kwargs)
NameError: global name 'kwargs' is not defined
如果我嘗試使用基於一個記憶:
CACHES = {
'default' : {
'BACKEND': 'johnny.backends.locmem.LocMemCache',
}
}
連接只是掛在那裏。我現在打開了零緩存。任何想法如何設置?
你發現了一個在JohnnyCache基於文件的後端的錯誤。請注意,我具有相同的版本,Memcached後端可以工作,因此您可以使用它。 – jpic 2012-02-29 07:36:07