Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

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

2 views
Skip to first unread message

Stuart Langridge

unread,
Jul 1, 2002, 10:31:16 AM7/1/02
to
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

- c o v e n t r y -

unread,
Jul 1, 2002, 12:08:04 PM7/1/02
to
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

0 new messages