Quixote 0.20
============

Quixote is yet another framework for developing Web applications in
Python.  The design goals were:

	1) To make the templating language as similar to Python in
	semantics as possible.  The aim is to make
	as many of the skills and structural techniques used in 
	writing regular Python code applicable to Web applications
	built using Quixote.

	2) To allow easy development of Web applications where the
	accent is more on complicated programming logic than
	complicated templating.

	3) The entire system should be implementable in a week or two.

Quixote has met goal #3, having been mostly implemented in a week, and
we think it also meets goal #1.  We are currently trying to write Web
applications using Quixote in an effort to verify that we've met goal
#2.

We've tried to reuse as much existing code as possible:

	* The HTTPRequest and HTTPResponse classes come from Zope,
	  with some modifications (mostly cutting out Zope-specific
	  code).  They fall under the Zope Public Licence, available
	  in doc/ZPL.txt.

	* The quixote.util.fcgi module is Robin Dunn's FastCGI module,
	  originally available from  
          <URL:http://starship.python.net/crew/robind/#fcgi>.


Overview
========

Quixote works by using a Python package to store all the code and HTML
for a Web-based application.  

PTL, Python Template Language, is used to mix HTML with Python code;
it relies on Jeremy Hylton's Python compiler code that is part of
Python 2.0.  The basic syntax is Python's, with a few small changes:

template barebones_header(title=None,
                          keywords=None,
                          description=None,
                          meta_info=None,
                          tree_info=None):
    """
    <html>
    <head>
    <title>%s</title>
    """ % html_quote(str(title))
    if description:
        '<meta name="description" content="%s">' % html_quote(description) 
    if keywords:
        '<meta name="keywords" content=" html_quote(keywords) ">'
    if meta_info:
        meta_info 

    '</head><body bgcolor="#ffffff">'

Note that 'template' is used instead of the 'def' keyword to define a
PTL template.  You can't have a docstring in a PTL template; instead,
Python expressions such as "<html>" are converted to a string and
appended to the final output.  (Exception to this rule: if an
expression evaluates to None, no text will be appended to the output.)

An import hook is defined so that PTL files (with the extension .ptl)
can be imported just like .py files containing Python source code.  A
template in PTL is similar to a Python function; if the above example
was placed into a file called standard.ptl, you could then do this:

import standard                   # Import the PTL file
output = standard.header(title = "Test Page")

Your Web application's package might look like this:

webapp/				# Root of package
	__init__.py			
	module1.py
	module2.py
	pages1.ptl
	pages2.ptl
	app1/			# Subpackage for one subsystem
		__init__.py
		module.py
		pages.ptl
	app2/			# Subpackage for another subsystem
		__init__.py
	...



-- 
A.M. Kuchling <akuchlin@mems-exchange.org>
Neil Schemenauer <nascheme@mems-exchange.org>
Greg Ward     <gward@python.net>


