1.1 --- a/docs/deploying.html Mon Apr 18 22:47:28 2005 +0000
1.2 +++ b/docs/deploying.html Tue Apr 19 22:32:46 2005 +0000
1.3 @@ -1,37 +1,39 @@
1.4 -<?xml version="1.0" encoding="iso-8859-1"?>
1.5 -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
1.6 - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
1.7 +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
1.8 <html xmlns="http://www.w3.org/1999/xhtml">
1.9 <head>
1.10 <title>Deploying a WebStack Application</title>
1.11 - <meta name="generator" content="amaya 8.1a, see http://www.w3.org/Amaya/" />
1.12 + <meta name="generator"
1.13 + content="amaya 8.1a, see http://www.w3.org/Amaya/" />
1.14 <link href="styles.css" rel="stylesheet" type="text/css" />
1.15 </head>
1.16 -
1.17 <body>
1.18 <h1>Deploying a WebStack Application</h1>
1.19 -
1.20 <p>The process of deploying a WebStack application should be as
1.21 -straightforward as taking some adapter or "glue" code and either running it
1.22 -or using the deployment processes of the server environment or framework in
1.23 +straightforward as taking some adapter or "glue" code and either
1.24 +running it
1.25 +or using the deployment processes of the server environment or
1.26 +framework in
1.27 which the application will be living.</p>
1.28 -
1.29 <h2>The Adapter Code</h2>
1.30 -
1.31 <p>What adapter or "glue" code does is to set up your applications main
1.32 resource object and to hook that object up with the underlying server
1.33 -environment. It typically looks something like this:</p>
1.34 -<pre>from WebStack.Adapters.CGI import deploy # import the support for the server environment
1.35 -from MyApplication import MyResource # import the main resource class
1.36 -deploy(MyResource()) # connect a resource object to the server environment</pre>
1.37 -
1.38 +environment. For the <code>MyApplication</code> <a
1.39 + href="resources.html">example</a> it typically looks something like
1.40 +this:</p>
1.41 +<pre>from WebStack.Adapters.BaseHTTPRequestHandler import deploy # import the support for the server environment<br />from MyApplication import MyResource # import the main resource class<br />deploy(MyResource()) # connect a resource object to the server environment</pre>
1.42 +<p>In the case of BaseHTTPRequestHandler, which is a module in the
1.43 +Python standard library, you can just run this code, making sure that
1.44 +the <code>MyApplication</code> module or package is on your <code>PYTHONPATH</code>.
1.45 +Then, you can visit <code>http://localhost:8080</code> in your
1.46 +browser and see the result.</p>
1.47 +<h2>More Demanding Adapter Code</h2>
1.48 <p>Unfortunately, not all server environments can be connected up with
1.49 applications this easily. Some environments require special classes and
1.50 -functions to be defined in the adapter code in order for the applications to
1.51 +functions to be defined in the adapter code in order for the
1.52 +applications to
1.53 be properly integrated into the environments. Here is a summary which
1.54 indicates the server environments or frameworks which need most work:</p>
1.55 -
1.56 -<table border="1" cellspacing="0" cellpadding="5">
1.57 +<table border="1" cellpadding="5" cellspacing="0">
1.58 <tbody>
1.59 <tr>
1.60 <th>Framework</th>
1.61 @@ -56,8 +58,8 @@
1.62 <tr>
1.63 <td>mod_python</td>
1.64 <td>Must implement <code>handler</code> function</td>
1.65 - <td>Web server runs the adapter code (which must be declared within
1.66 - Apache)</td>
1.67 + <td>Web server runs the adapter code (which must be declared
1.68 +within Apache)</td>
1.69 </tr>
1.70 <tr>
1.71 <td>Twisted</td>
1.72 @@ -67,9 +69,8 @@
1.73 <tr>
1.74 <td>Webware</td>
1.75 <td><= 0.8.1: Must implement <code>InstallInWebKit</code>
1.76 - function<br />
1.77 - > 0.8.1: Simple, but must provide a <code>urlParser</code>
1.78 - object</td>
1.79 +function<br />
1.80 +> 0.8.1: Simple, but must provide a <code>urlParser</code> object</td>
1.81 <td>Application must be deployed within WebKit</td>
1.82 </tr>
1.83 <tr>
1.84 @@ -84,7 +85,6 @@
1.85 </tr>
1.86 </tbody>
1.87 </table>
1.88 -
1.89 <h2>The Deployment Process</h2>
1.90 <ul>
1.91 <li><a href="writing-adapters.html">Writing Adapters</a></li>