Introduction to Webware: Developing Web Applications in Python
von
Jason Hildebrand
Jason is a graduate in Math and Computer Science from the University of Waterloo (Canada) and has been involved in the free software community since 1998, both privately and professionally. His contributions include gsysinfo, phormation and gnome-vim. He has spent two years living in Germany, and currently resides in Canada.
"Webware for Python" is a suite of software components for developing
object-oriented, web-based applications. It is an open-source framework
which includes an application server, servlets, Python Server Pages
(PSP), and an object-relational mapper (MiddleKit), and can be used in both
Linux/Unix and Windows environments. Plugins are available which
provide extra functionality, such as template systems, creation and validation
of HTML forms, user management, etc.
The talk begins with an overview of the Webware architecture and a
description of the different adapters that can be used to get a
web server to talk to Webware's application server.
The steps in the request-response path from web server to servlet are
described, including servlet instantiation and caching, with attention
given to the key Webware classes involved in the transaction.
Several example servlets are presented which demonstrate the use of
get/post variables, cookies, session variables, sending HTTP headers and
redirects.
Servlets may inherit from other servlets, and each Python Server Page
inherits from a servlet class, too. Techniques for using inheritance
are described which separate presentation from program logic and improve
website consistency while reducing maintenance costs.
The talk next describes how MiddleKit can be used to create a
hierarchy of "business" or "domain" objects. These objects can be used
and manipulated from within servlets or by stand-alone Python code. The
objects may be retrieved and stored by calling methods on the store
object or on container objects, which allows a complete object-oriented
design (the SQL is abstracted away).
An example is given using XML-RPC servlets to create a web
service. Sample code for both server and client are given.
Finally, the talk explains how Webware may be configured to log error
messages and/or report them to the developer by
mail automatically.
Webware info is available at http://webware.sourceforge.net.