Rehearsing new ACR look and feel

As some turbogears projects are starting to use ACR as their CMS library we received the first few requests by real users and the most prominent one is to have a better administrative section. Currently administration section is implemented by using the great tgext.admin and sprox, even if those are really good to quickly implement a CRUD section they might not couple very well when a more interactive and advanced user experience is required. So a transition phase that will end with a totally new administration section for ACR has been started, currently the system implements a new user interface still using the same backend as before to handle the operations, but on the long time the backend itself will […]

Injecting static content in TurboGears

Something that you usually need to do when providing a library or a reusable wsgi application is installing static data with the library itself. This can be quickly performed by adding something like package_data = {”:[‘*.html’, ‘*.js’, ‘*.css’, ‘*.png’]} to your setup.py But then how can we let our turbogears application serve that? For html files (genshi templates) the solution is quite simple, you can just expose them by using @expose(‘librarypackage.templatesdir.template’). For example supposing we are installing libcool with its templates in libcool/templates you can do @expose(‘libcool.templates.index’) For js and css files you can add them to your pages by creating a tw.api.JSLink or tw.api.CSSLink object. Just create inside your library something like: cool_js =¬†tw.api.JSLink(modname = __name__, filename = ‘static/cool.js’) […]

Syslog(3)

Recently Diego complained with me about the mod_accesslog I quickly drafted for Feng. I didn’t check much about supporting bare files log but I just used syslog since that’s what I use for all the services that support it. Luckily he fixed the glitches I left since his usage patterns are quite different than mine. Bare file logging usually is used by default in certain applications mostly because: You want to keep per-usage/per-user/per-deploy logs (think certain apache deploys) Your application doesn’t support syslog at all You didn’t knew about syslog and/or your logger daemon is a pain to configure You are fond of logrotate and/or you like to get your disk full of historic data Having syslog based logging usually […]