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
16 library), CGI, mod_python, Twisted and Webware are supported. Each framework
17 has its own set of strengths and weaknesses, but the idea is that deployment
18 concerns can be considered separately from the implementation of application
19 functionality. Consult the NOTES.txt files in each framework's subdirectory of
20 the docs directory for some notes on how applications may be run in each
21 environment.
22
23 Tested Frameworks
24 -----------------
25
26 BaseHTTPRequestHandler Python 2.2.2
27 CGI Apache 2.0.44
28 mod_python 3.0.3 (3.1.3 for cookie support)
29 Twisted 1.0.5
30 Webware 0.8.1, CVS (2004-02-06)
31
32 New in WebStack 0.5 (Changes Since WebStack 0.4)
33 ------------------------------------------------
34
35 Changed request body fields/parameters so that they are now represented using
36 Unicode objects rather than plain strings.
37 Introduced better support for Unicode in response streams.
38
39 New in WebStack 0.4 (Changes Since WebStack 0.3)
40 ------------------------------------------------
41
42 Added application definition of user identity, permitting alternative
43 authentication mechanisms.
44 Improved BaseHTTPRequestHandler and mod_python reliability around fields from
45 request bodies.
46 Provided stream and environment parameterisation in the CGI adapter.
47 Added LoginRedirect and Login examples.
48 Added get_path_without_query and fixed get_path behaviour.
49
50 New in WebStack 0.3 (Changes Since WebStack 0.2)
51 ------------------------------------------------
52
53 Added better header support for Webware (suggested by Ian Bicking).
54 Introduced CGI and Java Servlet support (the latter is currently
55 broken/unfinished).
56 Introduced support for cookies.
57
58 Future Work
59 -----------
60
61 Things to consider for future releases: improved cookie support, redirects,
62 session interfaces, access to shared resources and much better documentation.
63
64 Field access needs testing, especially for anything using the cgi.FieldStorage
65 class - Webware and Twisted certainly need reviewing. The acquisition of
66 fields from specific sources should be made more strict - some frameworks (eg.
67 mod_python) provide path fields in the body fields dictionary.
68
69 Cookie objects need defining strictly, especially since the standard library
70 Cookie object behaves differently to mod_python (and possibly Webware) Cookie
71 objects. Moreover, the set_cookie_value method needs to provide access to the
72 usual cookie parameters as supported by the frameworks.
73
74 Release Procedures
75 ------------------
76
77 Update the WebStack/__init__.py __version__ attribute.
78 Update the release notes (see above).
79 Check the setup.py file and ensure that all package directories are mentioned.
80 Tag, export, archive, upload.
81
82 Java Servlet API Notes
83 ----------------------
84
85 Using JythonServlet:
86
87 mkdir SimpleApp
88 mkdir SimpleApp/WEB-INF
89 mkdir SimpleApp/WEB-INF/classes
90 mkdir SimpleApp/WEB-INF/jython
91 mkdir SimpleApp/WEB-INF/lib
92 cp ${JYTHON_HOME}/jython.jar SimpleApp/WEB-INF/lib
93 cp -R ${WEBSTACK_HOME}/WebStack SimpleApp/WEB-INF/jython
94 cp -R ${WEBSTACK_HOME}/examples/Common/Simple SimpleApp/WEB-INF/jython
95 cp ${WEBSTACK_HOME}/examples/JavaServlet/SimpleApp.py SimpleApp
96 cp ${WEBSTACK_HOME}/examples/JavaServlet/web.xml SimpleApp/WEB-INF
97 mv SimpleApp ${CATALINA_HOME}/webapps
98
99 Unfortunately, PyServlet doesn't manage to find various modules in packages:
100
101 javax.servlet.ServletException: Could not create Jython servletTraceback (innermost last):
102 File "/data/home/paulb/Software/Java/jakarta-tomcat-4.1.27/webapps/SimpleApp/SimpleApp.py", line 3, in ?
103 ImportError: cannot import name JavaServlet
104
105 The same modules can be imported in interactive Jython.