What are the cache and session config variables in 0.9.6? I upgraded
my application with "paster create" and it contained:
beaker.session.key = ...
beaker.session.secret = ...
cache_dir = %(here)s/data
cache_enabled = true
cache.data = 3600
cache.static = 3600
I had defined cache.data and cache.static for my own use.
At some point I got a DeprecationWarning that all "cache_" variables
should be changed to "cache.". Looking back, it must have been
"cache_enabled" that triggered it. So I changed the underscores to
dots, and later noticed a "None" directory in my application,
containing container_lock files that looked like they belonged in the
data directory. I deleted the None directory and it came back. So i
created an empty directory with no access permissions to force an
exception, and got:
File '/home/mso/svn/hazweb/inews/inews/controllers/entry.py', line 44 in index
return render("mako", "/entry.html")
File
'/usr/local/lib/python2.5/site-packages/Pylons-0.9.6rc3-py2.5.egg/pylons/templating.py',
line 335 in render
**cache_args)
File
'/usr/local/lib/python2.5/site-packages/Pylons-0.9.6rc3-py2.5.egg/pylons/templating.py',
line 224 in render
**options)
File
'/usr/local/lib/python2.5/site-packages/Mako-0.1.8-py2.5.egg/mako/ext/turbogears.py',
line 49 in render
return template.render(**info)
File
'/usr/local/lib/python2.5/site-packages/Mako-0.1.8-py2.5.egg/mako/template.py',
line 114 in render
return runtime._render(self, self.callable_, args, data)
File
'/usr/local/lib/python2.5/site-packages/Mako-0.1.8-py2.5.egg/mako/runtime.py',
line 287 in _render
_render_context(template, callable_, context, *args,
**_kwargs_for_callable(callable_, data))
File
'/usr/local/lib/python2.5/site-packages/Mako-0.1.8-py2.5.egg/mako/runtime.py',
line 304 in _render_context
_exec_template(inherit, lclcontext, args=args, kwargs=kwargs)
File
'/usr/local/lib/python2.5/site-packages/Mako-0.1.8-py2.5.egg/mako/runtime.py',
line 337 in _exec_template
callable_(context, *args, **kwargs)
File '_site_mako_html', line 36 in render_body
File '/home/mso/svn/hazweb/inews/inews/lib/helpers.py', line 92 in get_flash
message = session.pop("flash", None)
File
'/usr/local/lib/python2.5/site-packages/Paste-1.4-py2.5.egg/paste/registry.py',
line 125 in __getattr__
return getattr(self._current_obj(), attr)
File
'/usr/local/lib/python2.5/site-packages/Beaker-0.7.4-py2.5.egg/beaker/session.py',
line 293 in __getattr__
return getattr(self._session(), attr)
File
'/usr/local/lib/python2.5/site-packages/Beaker-0.7.4-py2.5.egg/beaker/session.py',
line 289 in _session
self.__dict__['_sess'] = Session(req, use_cookies=True, **params)
File
'/usr/local/lib/python2.5/site-packages/Beaker-0.7.4-py2.5.egg/beaker/session.py',
line 101 in __init__
self.load()
File
'/usr/local/lib/python2.5/site-packages/Beaker-0.7.4-py2.5.egg/beaker/session.py',
line 183 in load
digest_filenames=False, **self.kwargs)
File
'/usr/local/lib/python2.5/site-packages/Beaker-0.7.4-py2.5.egg/beaker/container.py',
line 680 in __init__
util.verify_directory(self.file_dir)
File
'/usr/local/lib/python2.5/site-packages/Beaker-0.7.4-py2.5.egg/beaker/util.py',
line 32 in verify_directory
os.makedirs(dir, 0750)
File 'os.py', line 172 in makedirs
mkdir(name, mode)
OSError: [Errno 13] Permission denied: 'None/container_file'
I looked in a new Pylons application and saw it still has 'cache_dir'
so I put that back, and it stopped using the None directory.
The new application's config also includes these comments:
# If you'd like to fine-tune the individual locations of the cache data dirs
# for the Cache data, or the Session saves, un-comment the desired settings
# here:
#beaker.cache.data_dir = %(here)s/data/cache
#beaker.session.data_dir = %(here)s/data/sessions
This leads me to believe these variables supercede 'cache_dir' but
they don't: 'cache_dir' is necessary whether these are set or not.
Also note that the traceback is trying to restore a session even
though the variable name is "cache_dir" and not "session_dir".
So what is one "supposed" to have in the config file for sessions and caching?
Are my cache.data and cache.static variables going to conflict with
anything in Pylons or Beaker?
--
Mike Orr <[EMAIL PROTECTED]>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"pylons-discuss" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/pylons-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---