Karrigell is a simple web programming solution, written in Python, designed for web sites with moderate traffic, such as personal sites running on a home computer. It also provides an easy way to develop stand-alone applications using a web interface
With Karrigell you have
Python scripts are executed in a "clean" namespace including HTTP
environment, form fields and custom exceptions. When a form includes an
<INPUT name="myfield">
field, the value is available in the
script under the name _myfield
Two ways of mixing HTML and Python code are allowed :
<%
and
%>
this way :
<h1>Squares</h1> <% for i in range(10): print "%s :<b>%s</b>" %(i,i*i) %>
For authentication and session, two functions (unsurprisingly named
Authentication
and Session
) can be used in scripts.
Authentication
takes an authentication test function as first
argument, which checks if the AUTH_USER
and AUTH_PASSWORD
are accepted. Session()
is used to initialize or retrieve
a session object to which attributes can be set or read
The Include(file_or_script)
function inserts the output of the
script or file inside the output of current script ; this is useful for
headers or footers for instance. If it's a script it is executed in current
namespace. With IncludeComponent(component)
a reusable
component (a set of scripts performing a given task : calendar, forum, etc) can
be included in any page
The gadfly database can be used through the gadflyStorage
module
with a syntax similar to Python dictionaries instead of raw SQL requests
Karrigell comes with a detailed documentation (en français), and a set of demo files, including a minimal Wiki server
You can take a tour and see Karrigell
in action !
Go to the Sourceforge project page to download Karrigell
See the article in Linux Gazette : Dynamic Web Content with Karrigell
Last update 15 01 07