Castalian: the Active Server Pages object model for Python-embedded HTML pages

- c o v e n t r y - coventry at removethisandallhyphens-o-n-e.net
Mon Jul 1 12:08:04 EDT 2002


I've done something very very similar with a project I'm working on and 
found it quite useful.  Maybe we should colaborate some? - my system 
allows for page generation at runtime, or at 'build' time, allowing you 
to generate many pages from a db query or other data source... its 
closer to jsp than asp in the sense that you have to compile your pages 
with my system.  Hrm, let me post this on the web and lets compare notes.

-c

Stuart Langridge wrote:

> I've written a thing that provides the Active Server Pages object model to
> Python embedded in HTML pages; that way, those of you who think of CGI stuff
> in terms of Request.Querystring and Response.Cookies can use Python in pages
> on Apache.
> 
> The code might look something like:
> 
> <html>
> <head><title>Hello, world!</title></head>
> <body>
> Hello, world! (from HTML)<br>
> <?cas
> response.write("Hello, world! (from Castalian)<br>")
> 
> import os
> response.write("Your environment variables are:<br>")
> for i in os.environ.items():
>         response.write("%s=%s<br>\n" % i)
> 
> if request.querystring.has_key("foo"):
>         response.write("The 'foo' variable in the querystring was:")
>         response.write(request.querystring["foo"])
> ?>
> </body>
> </html>
> 
> I'd be interested in comments; Castalian implements a reasonable
> proportion of the ASP object model, and it's been used in some
> reasonable-sized projects.
> 
> Code available from http://www.kryogenix.org/code/castalian/.
> 
> sil
> 
> --
> 2. Make it halfway normal. I don't have any use for
> laser-beam-shooting pocket combs, or non-existent existents existing
> within their own existences, or ballpoint pens made out of lettuce.
>            -- CardinalT dictates rules for the raif Silly Game
> 




More information about the Python-list mailing list