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.
Please keep comments appropriate. I reserve the right to remove anonymous comments, flames, spammy, inappropriate, and other comments that I deem to be worth removing.
Note: New comments get placed in a "draft" status and will NOT show up on the site until I explicitly approve it. Usually that happens within 24 hours, but sometimes I go away and it takes a day or two.
Note 2: There is now a preview button for those of you who want to see a preview! However, it doesn't quite work the way you'd think it should work. I'll look into adjusting it some day.
Note 3: If you can't for some reason post a comment, send me an email: willg at bluesock dot org.
All contents Copyright 1996 to 2008 Will Guaraldi.
This work is licensed under a
Creative Commons Attribution-Noncommercial-Share Alike 3.0 United States License.