Keg - A python web framework

Terry Reedy tjreedy at udel.edu
Sat Aug 9 01:00:00 CEST 2008


eghansah wrote:

> As to the question on how different this is from other frameworks, I 
> think there are certainly many similarities. As I admitted in the 
> writeup, it draws from other projects including django. However, there 
> is one new idea I haven't seen anywhere . . . not yet at least. In keg, 
> I try to use URL pattern matching to run one or more functions required 
> to generate the page the URL is pointing to. For instance, when you try 
> to access a page like http://www.python.org <http://www.python.org/> Keg 
> will run all functions whose URL regex matches the URL requested. Their 
> output is then combined to generate the resulting page. With this 
> approach, we could have functions that generate menus, those that 
> generate page content and those that manage logins. These could all be 
> separately maintained. Keg ties their outputs all together to generate 
> the page. This means you could work on a menu system and not worry about 
> how you will generate ads for the page. The possibilities are endless . 
> . . at least in theory.
>  
> Also, each function receives the same input. This means that the 
> execution of one function does not really affect the execution of any 
> others. Hopefully this makes debugging much easier. Another good effect 
> of this idea is that all functions can be run in parallel since they are 
> independent.

So make your project an add-on to Django or other frameworks.  You tell 
Django to send all requests to key.py.  Keg.py runs the pattern matcher, 
call the functions, and re-assembles the result to pass back to Django 
for delivery.  The functions then have all other components of Django 
available.

In other words, don't reinvent the wheel, invent a new wheel cover*.

Terry Jan Reedy

This is possibly a new version of an old saying.  Other endings I found 
on Google (first 2000 hits) are '', 'improve it', 'improve on it', 'just 
add new tyres', 'just identify a colleague (who has done it)', 'Patch, 
extend or subclass an existing module', 're-invent its use!', 'write 
something new', and '(or worse, a flat tire)'.




More information about the Python-list mailing list