Will's blog

purpose: Will Kahn-Greene's blog of Python, Linux, random content, PyBlosxom, Miro, and other projects mixed in there ad hoc, half-baked, and with a twist of lemon

[ home | blog home | recent activity | guestbook | plugins i'm using (19) ]

Fri, 14 Apr 2006

Wedding site: using Pylons

I'm building a wedding site that contains mostly static material but has some material that's reminsicent of CMS and some material that's database-driven, too.

I surveyed the scene of Python web-frameworks and settled on Pylons for various reasons but mostly because:

I've spent 40 minutes or so fiddling with the site so far with only a few minor issues which required me to go poking through documentation. One of the issues is that I have a series of templates in my templates/ dir and I uncommented out the commented out code in the template.py controller so it's like this:

from weddingwww.lib.base import *

class TemplateController(BaseController):
    def view(self, url):
        from pkg_resources import resource_exists
        if resource_exists('weddingwww', url+'.myt'):
            m.subexec(url+'.myt')
        else:
            m.abort(404, "File not found '%s'" % url)

That doesn't seem to work as I'd expect. For example, if I go to http://localhost:5000/meeting, the url parameter ends up as meeting but the resources_exist returns a false even though there's a meeting.myt file in my templates directory.

After fiddling with this and trying to figure out where pkg_resources is defined, I just commented the code out and changed it to this:

from weddingwww.lib.base import *

class TemplateController(BaseController):
    def view(self, url):
        m.subexec(url+'.myt')

which obviously does the wrong thing if the file doesn't exist.

Thu, 05 Aug 2004

form input text centering

Had to look this up for a friend. The "text-align" css property allows you to align the value inside a form input text box.

  <input type=text style="text-align:center" name="blah" value="blah">

meta-refresh for html

I keep forgetting this and forgetting where I wrote it down. Irritating.

   <meta http-equiv="refresh" content="0; URL=http://bluesock.org/~willg/blog/">


pyblosxom::1.5 dev

All contents Copyright 1996 to 2010 Will Guaraldi Kahn-Greene.

Creative Commons License
This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 United States License.