ANNOUNCE: early alpha Quixote Web development tool

A.M. Kuchling amk1 at erols.com
Wed Jun 7 21:35:01 EDT 2000


The MEMS Exchange gang has been slowly working on a new framework for
writing Web apps.  The Web page for it is
http://www.mems-exchange.org/software/python/quixote/ .

The basic idea is that a Web application is written as a Python
package, and URLs are then treated as paths walking down into the
package.  Objects, functions, and methods are accessible through URLs
if they're listed in an __exports__ attribute of the object.
(Obviously this is inspired by Zope's object publishing.)  

Templating is done in Python Templating Language (PTL), which tries to
stick close to Python's statements and semantics:

<? template form(request, response) ?>
  <? block ?>
import string
from mems.ui import standard
<?/block?>

  <? standard.header(request, response, "Send Feedback") ?>

  <!-- Loop -->
  <? for item in compute_list_value() ?>
     <p> <? item.attribute ?>
  <? /for ?>

<? /template ?>

Through an import hook, if you put the above in a file called page.ptl
you can then do "import page ; string = page.form(...)", just as if
the template was a regular Python function.

Your Web application's package might look like this:
webapp/                         # Root of package
        __init__.py
        module.py (defining functions f1, f2, ...)
        pages.ptl (defining templates t1, t2, ...)

A URL like http://wherever/cgi-bin/quixote.cgi/module/f1 or
.../pages/would call function f1()

Quixote is still only partially finished, and we need to experiment
with it and figure out if it's a useful approach.  For example, not
every statement in PTL has been implemented yet, it needs to write
.ptlc files analogous to .pyc files, &c.

Anyway, we'd welcome opinions and suggestions about the design
(posting them to c.l.python is fine), and if you want to poke around
in the code, be our guest.  However, if you want to start actually
using Quixote for real work at this point, you're extremely brave (and
rather foolhardy); it might well get changed in incompatible ways in
the future.

--amk





More information about the Python-list mailing list