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 Using JythonServlet:
43
44 mkdir SimpleApp
45 mkdir SimpleApp/WEB-INF
46 mkdir SimpleApp/WEB-INF/classes
47 mkdir SimpleApp/WEB-INF/jython
48 mkdir SimpleApp/WEB-INF/lib
49 cp ${JYTHON_HOME}/jython.jar SimpleApp/WEB-INF/lib
50 cp -R ${WEBSTACK_HOME}/WebStack SimpleApp/WEB-INF/jython
51 cp -R ${WEBSTACK_HOME}/examples/Common/Simple SimpleApp/WEB-INF/jython
52 cp ${WEBSTACK_HOME}/examples/JavaServlet/SimpleApp.py SimpleApp
53 cp ${WEBSTACK_HOME}/examples/JavaServlet/web.xml SimpleApp/WEB-INF
54 mv SimpleApp ${CATALINA_HOME}/webapps
55
56 Unfortunately, PyServlet doesn't manage to find various modules in packages:
57
58 javax.servlet.ServletException: Could not create Jython servletTraceback (innermost last):
59 File "/data/home/paulb/Software/Java/jakarta-tomcat-4.1.27/webapps/SimpleApp/SimpleApp.py", line 3, in ?
60 ImportError: cannot import name JavaServlet
61
62 The same modules can be imported in interactive Jython.