Yet another python framework - YAPF

Python CGI - The basics of yapf and what it provides

There is a content management front end system that runs on the front of the site.

Content management system

Yapf concentrates on been a simple content management system without all the bells and whistles. Simple pages, easy to manage content. And been able to totally customise the pages on how they work. Mako is used as the templating engine on the front end of sites to drive the content on how the website is presented.

Heres an example of a cgi web application similar driven by database content.

#!/usr/bin/python
import pg
import os
import sys
from yapf import Yapf

conn = pg.connect(dbname='yapf, host='localhost')
dir = "/var/www/mysite.directory/"
y = Yapf(conn,dir,"http://"+os.environ['SERVER_NAME'])
# Check if any redirects are needed
y.check301()

mypage = y.findlink()
if mypage:
        print y.buildcontent(mypage)
        sys.exit(0)
else:
        # 404 Error
        y.custom404 = open(dir+"404.html").read()
        y.notfound()
sys.exit(0)

Features of yapf

  • Doesn't get in your way
  • Strong SQL support
  • Dynamic friendly urls loaded from a database
  • Includes content management system
  • Quickly build cgi forms within your python code without templating

CGI Python forms

Why another cgi python framework?

There are a lot of python frameworks out there. After much looking at the different frameworks I didn't find one clear package that suited all of my needs. I didn't want the be all and end all system that could be used for anything.

I wanted something that catered for developers with experience with PostgreSQL and cgi, who don't want something that will magically deal with all the SQL statements for you.

Download the code

The latest version can be downloaded from the subversion repository. Anyone can download the code, if you want write access to the repository email us so we can set you up an account. The software is licensed under the GPL.

svn checkout svn://svn.treshna.com/pub/yapf