Building Python Based Web Application

Gerard Flanagan grflanagan at yahoo.co.uk
Sat Sep 9 10:11:25 EDT 2006


James Stroud wrote:
> Hello All,
>
> I am interested in setting up a modest invoicing system for some
> consulting I am doing. I like the idea of managing this on the web and
> creating invoices and printing them from a browser. However, I'm not
> really sure where to start. I've played with some CMS applications, but
> they seem more for blogging (mamba, wordpress, etc.). Ideally, I would
> like to interface with mySQL (or whatever the favorite web-flavor
> database app is these days). I would like to be able to use my python
> skills.
>
> I confident that if I set out to write this from scatch, I will be
> seriously re-inventing the wheel, perhaps several times over.
>
> So, my question is, does anyone know of a book and/or some kind of
> framework that would make the best sense for what I am describing here?
> I've heard of Zope, but I would like to make sure its appropriate for
> the job before I spend 2 or 3 days getting acquainted with it. I'm adept
> at HTML, python, CSS, python-CGI, and interfacing with mySQL through
> DBI. I'm sure I could get something to work with these skills, but I
> want to minimize wheel re-invention as much as possible.
>
> Basically, I want a jump start on data-base oriented web development
> with a focus on applying my python skills.
>
> Any suggestions will be greatly appreciated.
>
> James
>
> --
> James Stroud
> UCLA-DOE Institute for Genomics and Proteomics
> Box 951570
> Los Angeles, CA 90095
>
> http://www.jamesstroud.com/

James,

Karrigell is serving me well at the moment for a low-traffic
intranet/library-cataloguing site. There are different ways of creating
your app (html inside python, python inside html, or Karrigell
services) - personally, I use services exclusively, so:

    library/books.ks/add,  library/books.ks/edit,
library/books.ks/delete
    library/authors.ks/add, library/authors.ks/edit,
library/authors.ks/delete

    etc.

( I think - to the best of my knowledge - these would equate to
'controllers' in other frameworks - BookController, AuthorController...
)

Karrigell will also serve static pages with a simple

    Include( 'mypage.html' )

I've recently set up 'lighttpd' webserver ( http://www.lighttpd.net ),
and this proxies easily to Karrigell with the following in
'lighttpd.conf':

server.modules = ( "mod_proxy" )
static-file.exclude-extensions = ( ".ks" )
$HTTP["url"] =~ "\.ks" {
        proxy.server = ( "" =>
            ((
                  host => "127.0.0.1",
                  port => 8081
            ))
        )
}

ie. "if there is a '.ks' in the url, ask Karrigell, otherwise it's
static so serve it yourself"

I'm also using 'leonardo' (http://leonardo.pyworks.org) as a 'Latest
News' cms - it runs as a cgi script ( which lighttpd will serve via
"mod_cgi":

server.modules = ( "mod_proxy", "mod_cgi")
static-file.exclude-extensions = ( ".ks", ".py", ".cgi" )
cgi-assign = ( ".py" => "/usr/local/bin/python")

(Also useful is my trusty , if imperfect, html generator,
htmlbuilder.py:

    http://gflanagan.net/site/python/htmlbuilder/htmlbuilder.py
)

Hope that helps.

Gerard




More information about the Python-list mailing list