1 Introduction
2 ------------
3
4 WebStack is a package which provides a common API for Python Web applications,
5 regardless of the underlying server or framework environment. It should be
6 possible with WebStack to design and implement an application and to choose a
7 deployment environment, without having to go back and rewrite large parts of
8 that application to work in the chosen environment or in other environments
9 (should the deployment requirements change after the application has been
10 written).
11
12 Framework Support
13 -----------------
14
15 Currently, BaseHTTPRequestHandler (via BaseHTTPServer in the standard library),
16 mod_python, Twisted and Webware are supported. Each framework has its own set of
17 strengths and weaknesses, but the idea is that deployment concerns can be
18 considered separately from the implementation of application functionality.
19 Consult the NOTES.txt files in each framework's subdirectory of the docs
20 directory for some notes on how applications may be run in each environment.
21
22 Tested Frameworks
23 -----------------
24
25 BaseHTTPRequestHandler Python 2.2.2
26 mod_python 3.0.3
27 Twisted 1.0.5
28 Webware 0.8.1, CVS (2004-02-06)
29
30 Future Work
31 -----------
32
33 Things to consider for future releases: higher-level authentication support,
34 cookie handling, redirects, session interfaces, and much better documentation.
35
36 Field access needs testing, especially for anything using the cgi.FieldStorage
37 class - Webware and Twisted certainly need reviewing.
38
39 Java Servlet API Notes
40 ----------------------
41
42 Trying to get WebStack working on top of the Java Servlet API was an
43 unsuccessful exercise. First, I tried to use jythonc at the top of a directory
44 structure consisting of WebStack, Simple and the SimpleApp.py source file, but
45 jythonc insisted on making a Java source file - WebStack.java - which
46 conflicts with the WebStack package. I would have expected it to make an
47 __init__.java file inside the WebStack directory containing the Java source
48 files.
49
50 Then, I decided to make .jar files for each package before compiling
51 SimpleApp.py, but this did not work particularly well. Each main.py file
52 imports the appropriate package (WebStack.Adapters.JavaServlet for WebStack,
53 Simple for Simple). The CLASSPATH environment variable was set to include
54 servlet.jar from Apache Tomcat and, for SimpleApp.py, the previously produced
55 .jar files.
56
57 [In the WebStack root directory...]
58 jythonc --all --jar .../WEB-INF/lib/WebStack.jar -J "-deprecation" main.py
59 [In the examples/Common directory...]
60 jythonc --all --jar .../WEB-INF/lib/Simple.jar -J "-deprecation" main.py
61 [In the examples/JavaServlet/SimpleApp directory...]
62 jythonc --all --workdir .../WEB-INF/classes -J "-deprecation" SimpleApp.py
63 cp .../jython.jar .../WEB-INF/lib
64
65 Somehow, the Simple package doesn't contain SimpleResource, even if the
66 appropriate main.py file explicitly references it.