paulb@68 | 1 | Introduction
|
paulb@68 | 2 | ------------
|
paulb@68 | 3 |
|
paulb@301 | 4 | WebStack is a package which provides a common API for Python Web
|
paulb@301 | 5 | applications, regardless of the underlying server or framework environment.
|
paulb@301 | 6 | It should be possible with WebStack to design and implement an application,
|
paulb@301 | 7 | to choose a deployment environment, and then to be able to deploy the
|
paulb@301 | 8 | application in a different environment later on without having to go back
|
paulb@301 | 9 | and rewrite substantial parts of the application.
|
paulb@60 | 10 |
|
paulb@362 | 11 | Quick Start
|
paulb@362 | 12 | -----------
|
paulb@362 | 13 |
|
paulb@362 | 14 | Try running the demo:
|
paulb@362 | 15 |
|
paulb@362 | 16 | python tools/demo.py
|
paulb@362 | 17 |
|
paulb@363 | 18 | An introductory guide to creating applications can be found in the docs
|
paulb@363 | 19 | directory - see docs/index.html for the start page.
|
paulb@363 | 20 |
|
paulb@363 | 21 | Contact, Copyright and Licence Information
|
paulb@363 | 22 | ------------------------------------------
|
paulb@363 | 23 |
|
paulb@363 | 24 | The current Web page for WebStack at the time of release is:
|
paulb@363 | 25 |
|
paulb@363 | 26 | http://www.boddie.org.uk/python/WebStack.html
|
paulb@363 | 27 |
|
paulb@363 | 28 | Copyright and licence information can be found in the docs directory - see
|
paulb@413 | 29 | docs/COPYING.txt, docs/LICENCE.txt and docs/LICENCE-PyServlet.txt for more
|
paulb@413 | 30 | information.
|
paulb@363 | 31 |
|
paulb@68 | 32 | Framework Support
|
paulb@68 | 33 | -----------------
|
paulb@68 | 34 |
|
paulb@218 | 35 | Currently, BaseHTTPRequestHandler (via BaseHTTPServer in the standard
|
paulb@301 | 36 | library), CGI, Jython/Java Servlet API, mod_python, Twisted, Webware, WSGI
|
paulb@301 | 37 | and Zope 2 are supported. Each framework has its own set of strengths and
|
paulb@301 | 38 | weaknesses, but the idea is that deployment concerns can be considered
|
paulb@301 | 39 | separately from the implementation of application functionality. Consult the
|
paulb@301 | 40 | NOTES.txt files in each framework's subdirectory of the docs directory for
|
paulb@301 | 41 | some notes on how applications may be run in each environment.
|
paulb@60 | 42 |
|
paulb@244 | 43 | Tested Frameworks Release Information
|
paulb@244 | 44 | ----------------- -------------------
|
paulb@68 | 45 |
|
paulb@362 | 46 | BaseHTTPRequestHandler Python 2.2.2, Python 2.3.3, Python 2.4.1
|
paulb@405 | 47 | CGI Apache 2.0.44, Apache 2.0.53, AOLserver 4.0.10, lighttpd 1.3.15
|
paulb@244 | 48 | Jython/Java Servlet API Jython 2.1, Java JDK 1.3.1_02, Tomcat 4.1.27 (Servlet 2.3)
|
paulb@244 | 49 | mod_python 3.0.3 (3.1.3 for framework cookie and session support)
|
paulb@308 | 50 | Twisted 1.0.5, 1.3.0
|
paulb@244 | 51 | Webware 0.8.1, CVS (2004-02-06)
|
paulb@304 | 52 | WSGI run_with_cgi (PEP 333)
|
paulb@388 | 53 | Zope 2.7.2-0, 2.8.0-final
|
paulb@388 | 54 |
|
paulb@409 | 55 | New in WebStack 1.0 (Changes since WebStack 0.10)
|
paulb@409 | 56 | -------------------------------------------------
|
paulb@409 | 57 |
|
paulb@430 | 58 | Changed the behaviour of get_fields_from_path to return Unicode data decoded
|
paulb@430 | 59 | using the optional encoding parameter or a common default encoding.
|
paulb@409 | 60 | Added Debian package support.
|
paulb@414 | 61 | Added automatic session directory creation for the WebStack sessions
|
paulb@414 | 62 | implementation.
|
paulb@418 | 63 | Added support for the repeated retrieval of sessions from the same WebStack
|
paulb@418 | 64 | session store, avoiding deadlocks.
|
paulb@415 | 65 | Fixed the calendar example, making it perform a proper function.
|
paulb@420 | 66 | Added the notion of processed virtual path info - the part of the original
|
paulb@426 | 67 | path info not represented in the current virtual path info.
|
paulb@426 | 68 | Added "pass through" behaviour to ResourceMap.MapResource (prompted by a patch
|
paulb@426 | 69 | from Scott Robinson).
|
paulb@427 | 70 | Fixed ResourceMap.MapResource to handle non-existent resources properly (where
|
paulb@427 | 71 | the virtual path info is only one component in length).
|
paulb@430 | 72 | Added convenience methods to Transaction for the decoding and encoding of path
|
paulb@430 | 73 | values (to and from Unicode objects) - see the decode_path and encode_path
|
paulb@430 | 74 | methods.
|
paulb@409 | 75 |
|
paulb@388 | 76 | New in WebStack 0.10 (Changes since WebStack 0.9)
|
paulb@388 | 77 | -------------------------------------------------
|
paulb@388 | 78 |
|
paulb@388 | 79 | Changes to make the tools/demo.py script work on Windows (and other) platforms
|
paulb@388 | 80 | (suggested by Jim Madsen).
|
paulb@394 | 81 | Fixed end of header newlines for CGI (suggested by Matt Harrison).
|
paulb@388 | 82 | Minor documentation fixes and improvements, adding information on AOLserver in
|
paulb@388 | 83 | the CGI and Webware notes.
|
paulb@395 | 84 | Changed the mod_python server name method to use the server object rather than
|
paulb@395 | 85 | the connection object.
|
paulb@396 | 86 | Added a parameter to the ResourceMap.MapResource class to permit automatic
|
paulb@398 | 87 | redirects into resource hierarchies when no trailing "/" was given in the URL;
|
paulb@398 | 88 | changed the updated virtual path info so that empty values may be set (the
|
paulb@398 | 89 | guarantee that "/" will always appear no longer applies).
|
paulb@398 | 90 | Fixed virtual path info retrieval when the value is an empty string.
|
paulb@192 | 91 |
|
paulb@314 | 92 | New in WebStack 0.9 (Changes since WebStack 0.8)
|
paulb@314 | 93 | ------------------------------------------------
|
paulb@314 | 94 |
|
paulb@314 | 95 | Standardised error handling in the adapters so that tracebacks can be
|
paulb@314 | 96 | suppressed and an internal server error condition raised.
|
paulb@314 | 97 | Added overriding of path info in transactions.
|
paulb@314 | 98 | Added a ResourceMap resource for dispatching to different resources
|
paulb@314 | 99 | according to path components.
|
paulb@329 | 100 | Standardised deployment for some frameworks (see docs/deploying.html).
|
paulb@329 | 101 | Introductory documentation in XHTML format.
|
paulb@343 | 102 | Added server name and port methods to the transaction.
|
paulb@363 | 103 | Added a simple demonstration application, incorporating many of the examples
|
paulb@363 | 104 | and launched under a single script.
|
paulb@373 | 105 | Fixed mod_python native sessions.
|
paulb@382 | 106 | Fixed Zope request stream access.
|
paulb@370 | 107 | WebStack is now licensed under the LGPL - see docs/COPYING.txt for details.
|
paulb@314 | 108 |
|
paulb@300 | 109 | New in WebStack 0.8 (Changes since WebStack 0.7)
|
paulb@295 | 110 | ------------------------------------------------
|
paulb@295 | 111 |
|
paulb@295 | 112 | Added a standard exception, EndOfResponse, which can be used to immediately
|
paulb@295 | 113 | stop the processing/production of a response; this is useful when resources
|
paulb@295 | 114 | need to issue a redirect without unnecessary content being generated, for
|
paulb@295 | 115 | example.
|
paulb@299 | 116 | Fixed path information for Zope.
|
paulb@301 | 117 | Added WSGI support.
|
paulb@308 | 118 | Verified Twisted 1.3.0 support with Python 2.3.3.
|
paulb@295 | 119 |
|
paulb@300 | 120 | New in WebStack 0.7 (Changes since WebStack 0.6)
|
paulb@192 | 121 | ------------------------------------------------
|
paulb@192 | 122 |
|
paulb@218 | 123 | Fixed path information semantics.
|
paulb@192 | 124 | Fixed file upload semantics.
|
paulb@227 | 125 | Fixed content type handling for Unicode output and for interpreting request
|
paulb@227 | 126 | body fields/parameters (although some improvement remains).
|
paulb@253 | 127 | Added a method to discover the chosen response stream encoding.
|
paulb@227 | 128 | Fixed field/parameter retrieval so that path and body fields are distinct,
|
paulb@227 | 129 | regardless of the framework employed.
|
paulb@363 | 130 | Added a method to get a combination of path and body fields (suggested by
|
paulb@363 | 131 | Jacob Smullyan).
|
paulb@192 | 132 | Introduced Zope 2 support.
|
paulb@247 | 133 | Improved Jython/Java Servlet API support (although a special PyServlet class
|
paulb@247 | 134 | must now be used, and certain libraries must be deployed with applications).
|
paulb@293 | 135 | Introduced authentication/authorisation support for Jython/Java Servlet API.
|
paulb@293 | 136 | Session support has been added (except for Webware 0.8.1).
|
paulb@247 | 137 | Alternative cookie support for mod_python has been added.
|
paulb@293 | 138 | Cookie support now supports encoded Unicode sequences for names and values.
|
paulb@68 | 139 |
|
paulb@300 | 140 | New in WebStack 0.6 (Changes since WebStack 0.5)
|
paulb@178 | 141 | ------------------------------------------------
|
paulb@178 | 142 |
|
paulb@178 | 143 | Introduced Jython/Java Servlet API support.
|
paulb@178 | 144 | Minor fixes to example applications and to BaseHTTPRequestHandler.
|
paulb@178 | 145 |
|
paulb@300 | 146 | New in WebStack 0.5 (Changes since WebStack 0.4)
|
paulb@171 | 147 | ------------------------------------------------
|
paulb@171 | 148 |
|
paulb@363 | 149 | Changed request body fields/parameters so that they are now represented
|
paulb@363 | 150 | using Unicode objects rather than plain strings.
|
paulb@171 | 151 | Introduced better support for Unicode in response streams.
|
paulb@171 | 152 |
|
paulb@300 | 153 | New in WebStack 0.4 (Changes since WebStack 0.3)
|
paulb@160 | 154 | ------------------------------------------------
|
paulb@140 | 155 |
|
paulb@140 | 156 | Added application definition of user identity, permitting alternative
|
paulb@140 | 157 | authentication mechanisms.
|
paulb@363 | 158 | Improved BaseHTTPRequestHandler and mod_python reliability around fields
|
paulb@363 | 159 | from request bodies.
|
paulb@142 | 160 | Provided stream and environment parameterisation in the CGI adapter.
|
paulb@140 | 161 | Added LoginRedirect and Login examples.
|
paulb@164 | 162 | Added get_path_without_query and fixed get_path behaviour.
|
paulb@140 | 163 |
|
paulb@300 | 164 | New in WebStack 0.3 (Changes since WebStack 0.2)
|
paulb@160 | 165 | ------------------------------------------------
|
paulb@120 | 166 |
|
paulb@120 | 167 | Added better header support for Webware (suggested by Ian Bicking).
|
paulb@120 | 168 | Introduced CGI and Java Servlet support (the latter is currently
|
paulb@120 | 169 | broken/unfinished).
|
paulb@120 | 170 | Introduced support for cookies.
|
paulb@120 | 171 |
|
paulb@68 | 172 | Future Work
|
paulb@68 | 173 | -----------
|
paulb@68 | 174 |
|
paulb@308 | 175 | (Essential)
|
paulb@308 | 176 |
|
paulb@308 | 177 | JythonServlet libraries need to be configured using sys.add_package when
|
paulb@308 | 178 | these do not feature in the compiled-in list. Adding such configuration to
|
paulb@308 | 179 | the handler may be most appropriate (since the web.xml file can be too
|
paulb@308 | 180 | arcane), but this needs testing.
|
paulb@308 | 181 |
|
paulb@308 | 182 | (Important)
|
paulb@308 | 183 |
|
paulb@165 | 184 | Things to consider for future releases: improved cookie support, redirects,
|
paulb@218 | 185 | access to shared resources and much better documentation.
|
paulb@68 | 186 |
|
paulb@363 | 187 | Field access needs testing, especially for anything using the
|
paulb@363 | 188 | cgi.FieldStorage class, and the way file uploads are exposed should be
|
paulb@363 | 189 | reviewed (currently the meta-data is not exposed). The acquisition of fields
|
paulb@363 | 190 | from specific sources should be tested with different request methods - some
|
paulb@363 | 191 | frameworks provide path fields in the body fields dictionary, others (eg.
|
paulb@363 | 192 | Zope) change the fields exposed depending on request method.
|
paulb@248 | 193 |
|
paulb@363 | 194 | Interpretation of path field encodings needs to be verified. Currently,
|
paulb@363 | 195 | stray path fields are handled (eg. in WebStack.Helpers.Request) as being
|
paulb@363 | 196 | ISO-8859-1, but it might be the case that some such fields might be
|
paulb@363 | 197 | submitted as UTF-8.
|
paulb@102 | 198 |
|
paulb@102 | 199 | Cookie objects need defining strictly, especially since the standard library
|
paulb@363 | 200 | Cookie object behaves differently to mod_python (and possibly Webware)
|
paulb@363 | 201 | Cookie objects. Moreover, the set_cookie_value method needs to provide
|
paulb@363 | 202 | access to the usual cookie parameters as supported by the frameworks. The
|
paulb@363 | 203 | standard library Cookie module has issues with Unicode cookie names (and
|
paulb@363 | 204 | possibly values) - this is worked around, but it would be best to resolve
|
paulb@363 | 205 | this comprehensively.
|
paulb@90 | 206 |
|
paulb@363 | 207 | UTF-16 (and possibly other encodings) causes problems with HTML form data
|
paulb@363 | 208 | sent in POST requests using the application/x-www-form-urlencoded content
|
paulb@363 | 209 | type. This should be reviewed at a later date when proper standardisation
|
paulb@363 | 210 | has taken place.
|
paulb@218 | 211 |
|
paulb@239 | 212 | Session support, especially through WebStack.Helpers.Session, should be
|
paulb@248 | 213 | reviewed and be made compatible with non-cookie mechanisms.
|
paulb@248 | 214 |
|
paulb@248 | 215 | HeaderValue objects should be employed more extensively. Thus, the header
|
paulb@248 | 216 | access methods may need to change their behaviour slightly.
|
paulb@248 | 217 |
|
paulb@248 | 218 | Investigate the nicer functions in the cgi module, discarding the "magic"
|
paulb@248 | 219 | stuff like FieldStorage.
|
paulb@239 | 220 |
|
paulb@304 | 221 | WSGI support could demand that a special "end of headers" method be
|
paulb@304 | 222 | introduced into WebStack, thus making response output more efficient (and
|
paulb@304 | 223 | probably also for other frameworks, too).
|
paulb@304 | 224 |
|
paulb@363 | 225 | The algorithm employed in the WebStack.Helpers.Auth.get_token function
|
paulb@363 | 226 | should be reviewed and improved for better security.
|
paulb@332 | 227 |
|
paulb@336 | 228 | Investigate proper support for HEAD, OPTIONS and other request methods.
|
paulb@336 | 229 |
|
paulb@365 | 230 | Consider packages for different operating systems.
|
paulb@365 | 231 |
|
paulb@355 | 232 | (Completed/rejected)
|
paulb@355 | 233 |
|
paulb@355 | 234 | The location of deployed applications in the filesystem should be exposed to
|
paulb@355 | 235 | those applications. (This is actually available in the __file__ module
|
paulb@355 | 236 | variable.)
|
paulb@355 | 237 |
|
paulb@355 | 238 | Path information should be consistent across all frameworks, and the "path
|
paulb@355 | 239 | info" value should be meaningful. (This should now be correct.)
|
paulb@355 | 240 |
|
paulb@159 | 241 | Release Procedures
|
paulb@159 | 242 | ------------------
|
paulb@159 | 243 |
|
paulb@159 | 244 | Update the WebStack/__init__.py __version__ attribute.
|
paulb@329 | 245 | Change the version number and package filename/directory in the documentation.
|
paulb@332 | 246 | Change code examples in the documentation if appropriate.
|
paulb@159 | 247 | Update the release notes (see above).
|
paulb@159 | 248 | Check the setup.py file and ensure that all package directories are mentioned.
|
paulb@417 | 249 | Check the release information in the PKG-INFO file and in the package
|
paulb@417 | 250 | changelog (and other files).
|
paulb@253 | 251 | Tag, export.
|
paulb@247 | 252 | Generate the PyServlet classes.
|
paulb@355 | 253 | Generate the API documentation.
|
paulb@384 | 254 | Remove generated .pyc files: rm `find . -name "*.pyc"`
|
paulb@253 | 255 | Archive, upload.
|
paulb@367 | 256 | Upload the introductory documentation.
|
paulb@365 | 257 | Update PyPI, PythonInfo Wiki, Vaults of Parnassus entries.
|
paulb@355 | 258 |
|
paulb@355 | 259 | Generating the API Documentation
|
paulb@355 | 260 | --------------------------------
|
paulb@355 | 261 |
|
paulb@363 | 262 | In order to prepare the API documentation, it is necessary to generate some
|
paulb@363 | 263 | Web pages from the Python source code. For this, the epydoc application must
|
paulb@363 | 264 | be available on your system. Then, inside the WebStack directory, run the
|
paulb@355 | 265 | apidocs.sh tool script as follows:
|
paulb@355 | 266 |
|
paulb@355 | 267 | ./tools/apidocs.sh
|
paulb@355 | 268 |
|
paulb@355 | 269 | Some warnings may be generated by the script, but the result should be a new
|
paulb@355 | 270 | apidocs directory within the WebStack directory.
|