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