1 <?xml version="1.0" encoding="iso-8859-1"?> 2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 3 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 4 <html xmlns="http://www.w3.org/1999/xhtml"> 5 <head> 6 <title>Deploying a WebStack Application</title> 7 <meta name="generator" content="amaya 8.1a, see http://www.w3.org/Amaya/" /> 8 <link href="styles.css" rel="stylesheet" type="text/css" /> 9 </head> 10 11 <body> 12 <h1>Deploying a WebStack Application</h1> 13 14 <p>The process of deploying a WebStack application should be as 15 straightforward as taking some adapter or "glue" code and either running it 16 or using the deployment processes of the server environment or framework in 17 which the application will be living.</p> 18 19 <h2>The Adapter Code</h2> 20 21 <p>What adapter or "glue" code does is to set up your applications main 22 resource object and to hook that object up with the underlying server 23 environment. It typically looks something like this:</p> 24 <pre>from WebStack.Adapters.CGI import deploy # import the support for the server environment 25 from MyApplication import MyResource # import the main resource class 26 deploy(MyResource()) # connect a resource object to the server environment</pre> 27 28 <p>Unfortunately, not all server environments can be connected up with 29 applications this easily. Some environments require special classes and 30 functions to be defined in the adapter code in order for the applications to 31 be properly integrated into the environments. Here is a summary which 32 indicates the server environments or frameworks which need most work:</p> 33 34 <table border="1" cellspacing="0" cellpadding="5"> 35 <tbody> 36 <tr> 37 <th>Framework</th> 38 <th>Adapter Code Requirements</th> 39 <th>Deployment Process</th> 40 </tr> 41 <tr> 42 <td>BaseHTTPRequestHandler</td> 43 <td>Simple - see above</td> 44 <td>Run the adapter code directly</td> 45 </tr> 46 <tr> 47 <td>CGI</td> 48 <td>Simple - see above</td> 49 <td>Web server runs the adapter code</td> 50 </tr> 51 <tr> 52 <td>Java Servlet</td> 53 <td>Must subclass <code>HttpServlet</code></td> 54 <td>Application must be deployed using supplied tools</td> 55 </tr> 56 <tr> 57 <td>mod_python</td> 58 <td>Must implement <code>handler</code> function</td> 59 <td>Web server runs the adapter code (which must be declared within 60 Apache)</td> 61 </tr> 62 <tr> 63 <td>Twisted</td> 64 <td>Simple - see above</td> 65 <td>Run the adapter code directly</td> 66 </tr> 67 <tr> 68 <td>Webware</td> 69 <td><= 0.8.1: Must implement <code>InstallInWebKit</code> 70 function<br /> 71 > 0.8.1: Simple, but must provide a <code>urlParser</code> 72 object</td> 73 <td>Application must be deployed within WebKit</td> 74 </tr> 75 <tr> 76 <td>WSGI</td> 77 <td>Simple - see above</td> 78 <td>Web server runs the adapter code</td> 79 </tr> 80 <tr> 81 <td>Zope</td> 82 <td>Must provide lots of Zope administative classes and functions</td> 83 <td>Application must be deployed within Zope</td> 84 </tr> 85 </tbody> 86 </table> 87 88 <h2>The Deployment Process</h2> 89 <ul> 90 <li><a href="writing-adapters.html">Writing Adapters</a></li> 91 <li><a href="pythonpath.html">Getting PYTHONPATH Righ</a>t</li> 92 <li><a href="deploying-applications.html">Deploying an Application</a></li> 93 </ul> 94 </body> 95 </html>