Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>So, using the <a href="http://turbogears.org/2.1/docs/main/Caching.html" rel="nofollow">TurboGears documentation</a> as a guide, what settings do you have for the url?</p> <pre><code>[app:main] beaker.cache.type = ext:memcached beaker.cache.url = 127.0.0.1:11211 # you can also store sessions in memcached, should you wish # beaker.session.type = ext:memcached # beaker.session.url = 127.0.0.1:11211 </code></pre> <p>It looks to me as if <a href="https://github.com/tav/pylibs/blob/master/beaker/ext/memcached.py" rel="nofollow">memcached requires a url</a> to initialize correctly:</p> <pre><code>def __init__(self, namespace, url=None, data_dir=None, lock_dir=None, **params): NamespaceManager.__init__(self, namespace) if not url: raise MissingCacheParameter("url is required") </code></pre> <p>I am not really sure why the code allows url to be optional (defaulting to None) and then requires it. I think it would have been simpler just to require the url as an argument.</p> <hr> <p>Later: in response to your next question:</p> <blockquote> <p>when I used cache.url I've got next error: AttributeError: 'MemcachedNamespaceManager' object has no attribute 'lock_dir'</p> </blockquote> <p>I'd say that the way I read the code below, you have to provide either <code>lock_dir</code> or <code>data_dir</code> to initialize self.lock_dir:</p> <pre><code> if lock_dir: self.lock_dir = lock_dir elif data_dir: self.lock_dir = data_dir + "/container_mcd_lock" if self.lock_dir: verify_directory(self.lock_dir) </code></pre> <p>You can replicate that exact error using this test code:</p> <pre><code>class Foo(object): def __init__(self, lock_dir=None, data_dir=None): if lock_dir: self.lock_dir = lock_dir elif data_dir: self.lock_dir = data_dir + "/container_mcd_lock" if self.lock_dir: verify_directory(self.lock_dir) f = Foo() </code></pre> <p>It turns out like this:</p> <pre><code>&gt;&gt;&gt; f = Foo() Traceback (most recent call last): File "&lt;stdin&gt;", line 1, in &lt;module&gt; File "&lt;stdin&gt;", line 7, in __init__ AttributeError: 'Foo' object has no attribute 'lock_dir' </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload