Commits

mitsuhiko  committed 0c47d98

Fixed a bug in the documentation and rebuilded for release

  • Participants
  • Parent commits f6bff4b
  • Tags 0.4

Comments (0)

Files changed (17)

 f93fb9db6fce63c32849e7369ae0b16e137a5b2b 0.2
 40e894d190577011b989051e7104fc4444a72ef4 0.3
 7bcec7da720c22ba07153b832fb6657d97d4b2d6 0.3.1
-209e826e20876982d513dfe967b2a0c9f3fdfbb5 0.4

File docs/build/debug.html

 based debugger (which allows to execute code in the context of the
 traceback&#8217;s frames).</p>
 <p>Usage:</p>
-<div class="syntax"><pre><span class="k">from</span> <span class="nn">werkzeug</span> <span class="k">import</span> <span class="n">DebuggedApplication</span><span class="p">,</span> <span class="n">run_simple</span>
-<span class="k">from</span> <span class="nn">myapplication</span> <span class="k">import</span> <span class="n">application</span>
+<div class="syntax"><pre><span class="kn">from</span> <span class="nn">werkzeug</span> <span class="kn">import</span> <span class="n">DebuggedApplication</span><span class="p">,</span> <span class="n">run_simple</span>
+<span class="kn">from</span> <span class="nn">myapplication</span> <span class="kn">import</span> <span class="n">application</span>
 
 <span class="n">application</span> <span class="o">=</span> <span class="n">DebuggedApplication</span><span class="p">(</span><span class="n">application</span><span class="p">,</span> <span class="n">evalex</span><span class="o">=</span><span class="bp">True</span><span class="p">)</span>
 

File docs/build/deploying.html

 <div class="section">
 <h3 id="example-configuration">Example Configuration</h3>
 <p>Here is a small example configuration for Apache and mod_wsgi:</p>
-<div class="syntax"><pre><span class="k">from</span> <span class="nn">yourapplicaiton</span> <span class="k">import</span> <span class="n">YourWSGIApplication</span>
+<div class="syntax"><pre><span class="kn">from</span> <span class="nn">yourapplicaiton</span> <span class="kn">import</span> <span class="n">YourWSGIApplication</span>
 
 <span class="c"># mod_wsgi just wants an object called `application` it will use</span>
 <span class="c"># for dispatching.  Pretty simple, huh?</span>

File docs/build/exceptions.html

 within your views to trigger a standard non 200 response.</p>
 <div class="section">
 <h3 id="usage-example">Usage Example</h3>
-<div class="syntax"><pre><span class="k">from</span> <span class="nn">werkzeug</span> <span class="k">import</span> <span class="n">BaseRequest</span><span class="p">,</span> <span class="n">responder</span>
-<span class="k">from</span> <span class="nn">werkzeug.exceptions</span> <span class="k">import</span> <span class="n">HTTPException</span><span class="p">,</span> <span class="n">NotFound</span>
+<div class="syntax"><pre><span class="kn">from</span> <span class="nn">werkzeug</span> <span class="kn">import</span> <span class="n">BaseRequest</span><span class="p">,</span> <span class="n">responder</span>
+<span class="kn">from</span> <span class="nn">werkzeug.exceptions</span> <span class="kn">import</span> <span class="n">HTTPException</span><span class="p">,</span> <span class="n">NotFound</span>
 
 <span class="k">def</span> <span class="nf">view</span><span class="p">(</span><span class="n">request</span><span class="p">):</span>
     <span class="k">raise</span> <span class="n">NotFound</span><span class="p">()</span>
 represent do not represent errors are missing.  For redirects you can use
 the <cite>redirect</cite> function from the utilities.</p>
 <p>If you want to add an error yourself you can subclass <cite>HTTPException</cite>:</p>
-<div class="syntax"><pre><span class="k">from</span> <span class="nn">werkzeug.exceptions</span> <span class="k">import</span> <span class="n">HTTPException</span>
+<div class="syntax"><pre><span class="kn">from</span> <span class="nn">werkzeug.exceptions</span> <span class="kn">import</span> <span class="n">HTTPException</span>
 
 <span class="k">class</span> <span class="nc">PaymentRequred</span><span class="p">(</span><span class="n">HTTPException</span><span class="p">):</span>
     <span class="n">code</span> <span class="o">=</span> <span class="mf">402</span>

File docs/build/index.html

 organize your code when using Werkzeug.</li>
 <li><a class="reference" href="libraries.html">Other Libraries</a> &#8212; links to other libraries you
 can use with Werkzeug.</li>
+<li><a class="reference" href="reusableapps.html">Reusable Applications</a>  &#8212; how to develop modular
+applications with reusable bits.</li>
 <li><a class="reference" href="deploying.html">Deploying WSGI Applications</a> &#8212; ready for production?
 This page covers all the details you have to know to deploy your
 application on various webservers.</li>

File docs/build/local.html

 <div class="section">
 <h3 id="nutshell">Nutshell</h3>
 <p>Here a simple example how you can use werkzeug.local:</p>
-<div class="syntax"><pre><span class="k">from</span> <span class="nn">werkzeug</span> <span class="k">import</span> <span class="n">Local</span><span class="p">,</span> <span class="n">LocalManager</span>
+<div class="syntax"><pre><span class="kn">from</span> <span class="nn">werkzeug</span> <span class="kn">import</span> <span class="n">Local</span><span class="p">,</span> <span class="n">LocalManager</span>
 
 <span class="n">local</span> <span class="o">=</span> <span class="n">Local</span><span class="p">()</span>
 <span class="n">local_manager</span> <span class="o">=</span> <span class="n">LocalManager</span><span class="p">([</span><span class="n">local</span><span class="p">])</span>
 a proxied object.  The only operations not supported for forwarding
 are right handed operands and any kind of assignment.</p>
 <p>Example usage:</p>
-<div class="syntax"><pre><span class="k">from</span> <span class="nn">werkzeug</span> <span class="k">import</span> <span class="n">Local</span>
+<div class="syntax"><pre><span class="kn">from</span> <span class="nn">werkzeug</span> <span class="kn">import</span> <span class="n">Local</span>
 <span class="n">l</span> <span class="o">=</span> <span class="n">Local</span><span class="p">()</span>
 <span class="n">request</span> <span class="o">=</span> <span class="n">l</span><span class="p">(</span><span class="s">&#39;request&#39;</span><span class="p">)</span>
 <span class="n">user</span> <span class="o">=</span> <span class="n">l</span><span class="p">(</span><span class="s">&#39;user&#39;</span><span class="p">)</span>
 </dl>
 <p>Keep in mind that <tt class="docutils literal"><span class="pre">repr()</span></tt> is also forwarded, so if you want to find
 out if you are dealing with a proxy you can do an <tt class="docutils literal"><span class="pre">isinstance()</span></tt> check:</p>
-<div class="syntax"><pre><span class="gp">&gt;&gt;&gt; </span><span class="k">from</span> <span class="nn">werkzeug</span> <span class="k">import</span> <span class="n">LocalProxy</span>
+<div class="syntax"><pre><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">werkzeug</span> <span class="kn">import</span> <span class="n">LocalProxy</span>
 <span class="gp">&gt;&gt;&gt; </span><span class="nb">isinstance</span><span class="p">(</span><span class="n">request</span><span class="p">,</span> <span class="n">LocalProxy</span><span class="p">)</span>
 <span class="go">True</span>
 </pre></div>
 <p>You can also create proxy objects by hand:</p>
-<div class="last"><div class="syntax"><pre><span class="k">from</span> <span class="nn">werkzeug</span> <span class="k">import</span> <span class="n">Local</span><span class="p">,</span> <span class="n">LocalProxy</span>
+<div class="last"><div class="syntax"><pre><span class="kn">from</span> <span class="nn">werkzeug</span> <span class="kn">import</span> <span class="n">Local</span><span class="p">,</span> <span class="n">LocalProxy</span>
 <span class="n">local</span> <span class="o">=</span> <span class="n">Local</span><span class="p">()</span>
 <span class="n">request</span> <span class="o">=</span> <span class="n">LocalProxy</span><span class="p">(</span><span class="n">local</span><span class="p">,</span> <span class="s">&#39;request&#39;</span><span class="p">)</span>
 </pre></div>

File docs/build/organizing.html

 <p>It&#8217;s also a good idea to call the file something like <tt class="docutils literal"><span class="pre">main.py</span></tt> or
 <tt class="docutils literal"><span class="pre">application.py</span></tt> and locate it in the root of the package.  This is what it
 <em>could</em> look like:</p>
-<div class="syntax"><pre><span class="k">from</span> <span class="nn">werkzeug</span> <span class="k">import</span> <span class="n">Request</span><span class="p">,</span> <span class="n">Response</span><span class="p">,</span> <span class="n">import_string</span>
-<span class="k">from</span> <span class="nn">werkzeug.exceptions</span> <span class="k">import</span> <span class="n">HTTPException</span>
-<span class="k">from</span> <span class="nn">werkzeug.routing</span> <span class="k">import</span> <span class="n">RequestRedirect</span>
-<span class="k">from</span> <span class="nn">mypackage.urls</span> <span class="k">import</span> <span class="n">url_map</span>
+<div class="syntax"><pre><span class="kn">from</span> <span class="nn">werkzeug</span> <span class="kn">import</span> <span class="n">Request</span><span class="p">,</span> <span class="n">Response</span><span class="p">,</span> <span class="n">import_string</span>
+<span class="kn">from</span> <span class="nn">werkzeug.exceptions</span> <span class="kn">import</span> <span class="n">HTTPException</span>
+<span class="kn">from</span> <span class="nn">werkzeug.routing</span> <span class="kn">import</span> <span class="n">RequestRedirect</span>
+<span class="kn">from</span> <span class="nn">mypackage.urls</span> <span class="kn">import</span> <span class="n">url_map</span>
 
 <span class="k">def</span> <span class="nf">application</span><span class="p">(</span><span class="n">environ</span><span class="p">,</span> <span class="n">start_response</span><span class="p">):</span>
     <span class="n">url_adapter</span> <span class="o">=</span> <span class="n">url_map</span><span class="o">.</span><span class="n">bind_to_environ</span><span class="p">(</span><span class="n">environ</span><span class="p">)</span>
 template engine.  In this example we will use the <a class="reference" href="http://jinja.pocoo.org/">Jinja</a> template engine -
 basically because it&#8217;s something we use, too - but you can of course use any
 template engine:</p>
-<div class="syntax"><pre><span class="k">from</span> <span class="nn">jinja</span> <span class="k">import</span> <span class="n">Environment</span><span class="p">,</span> <span class="n">PackageLoader</span>
-<span class="k">from</span> <span class="nn">werkzeug</span> <span class="k">import</span> <span class="n">Response</span>
+<div class="syntax"><pre><span class="kn">from</span> <span class="nn">jinja</span> <span class="kn">import</span> <span class="n">Environment</span><span class="p">,</span> <span class="n">PackageLoader</span>
+<span class="kn">from</span> <span class="nn">werkzeug</span> <span class="kn">import</span> <span class="n">Response</span>
 
 <span class="n">env</span> <span class="o">=</span> <span class="n">Environment</span><span class="p">(</span><span class="n">loader</span><span class="o">=</span><span class="n">PackageLoader</span><span class="p">(</span><span class="s">&#39;mypackage&#39;</span><span class="p">,</span> <span class="s">&#39;templates&#39;</span><span class="p">))</span>
 
 <h3 id="urls">URLs</h3>
 <p>Because we use the Werkzeug URL routing system in this example and the URLs
 are stored in <cite>urls.py</cite>, we need that file:</p>
-<div class="syntax"><pre><span class="k">from</span> <span class="nn">werkzeug.routing</span> <span class="k">import</span> <span class="n">Map</span><span class="p">,</span> <span class="n">Rule</span>
+<div class="syntax"><pre><span class="kn">from</span> <span class="nn">werkzeug.routing</span> <span class="kn">import</span> <span class="n">Map</span><span class="p">,</span> <span class="n">Rule</span>
 
 <span class="n">url_map</span> <span class="o">=</span> <span class="n">Map</span><span class="p">([</span>
     <span class="n">Rule</span><span class="p">(</span><span class="s">&#39;/&#39;</span><span class="p">,</span> <span class="s">&#39;static.index&#39;</span><span class="p">)</span>
 <h3 id="view">View</h3>
 <p>Here is the view defined above.  It must be saved in
 <cite>myprojects/views/static.py</cite> as defined above:</p>
-<div class="syntax"><pre><span class="k">from</span> <span class="nn">myproject.utils</span> <span class="k">import</span> <span class="n">TemplateResponse</span>
+<div class="syntax"><pre><span class="kn">from</span> <span class="nn">myproject.utils</span> <span class="kn">import</span> <span class="n">TemplateResponse</span>
 
 <span class="k">def</span> <span class="nf">index</span><span class="p">(</span><span class="n">req</span><span class="p">):</span>
     <span class="k">return</span> <span class="n">TemplateResponse</span><span class="p">(</span><span class="s">&#39;index.html&#39;</span><span class="p">,</span> <span class="n">title</span><span class="o">=</span><span class="s">&#39;Welcome&#39;</span><span class="p">)</span>

File docs/build/pygments.css

+.syntax .hll { background-color: #ffffcc }
 .syntax  { background: #f0f3f3; }
 .syntax .c { color: #0099FF; font-style: italic } /* Comment */
 .syntax .err { color: #AA0000; background-color: #FFAAAA } /* Error */
 .syntax .gt { color: #99CC66 } /* Generic.Traceback */
 .syntax .kc { color: #006699; font-weight: bold } /* Keyword.Constant */
 .syntax .kd { color: #006699; font-weight: bold } /* Keyword.Declaration */
+.syntax .kn { color: #006699; font-weight: bold } /* Keyword.Namespace */
 .syntax .kp { color: #006699 } /* Keyword.Pseudo */
 .syntax .kr { color: #006699; font-weight: bold } /* Keyword.Reserved */
 .syntax .kt { color: #007788; font-weight: bold } /* Keyword.Type */

File docs/build/routing.html

 <div class="section">
 <h3 id="quickstart">Quickstart</h3>
 <p>Here a simple example which could be the URL definition for a blog:</p>
-<div class="syntax"><pre><span class="k">from</span> <span class="nn">werkzeug.routing</span> <span class="k">import</span> <span class="n">Map</span><span class="p">,</span> <span class="n">Rule</span><span class="p">,</span> <span class="n">NotFound</span><span class="p">,</span> <span class="n">RequestRedirect</span>
+<div class="syntax"><pre><span class="kn">from</span> <span class="nn">werkzeug.routing</span> <span class="kn">import</span> <span class="n">Map</span><span class="p">,</span> <span class="n">Rule</span><span class="p">,</span> <span class="n">NotFound</span><span class="p">,</span> <span class="n">RequestRedirect</span>
 
 <span class="n">url_map</span> <span class="o">=</span> <span class="n">Map</span><span class="p">([</span>
     <span class="n">Rule</span><span class="p">(</span><span class="s">&#39;/&#39;</span><span class="p">,</span> <span class="n">endpoint</span><span class="o">=</span><span class="s">&#39;blog/index&#39;</span><span class="p">),</span>
 can be used as WSGI responses.  The will all render generic error or
 redirect pages.</p>
 <p>Here is a small example for matching:</p>
-<div class="syntax"><pre><span class="gp">&gt;&gt;&gt; </span><span class="k">from</span> <span class="nn">werkzeug.routing</span> <span class="k">import</span> <span class="n">Map</span><span class="p">,</span> <span class="n">Rule</span>
+<div class="syntax"><pre><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">werkzeug.routing</span> <span class="kn">import</span> <span class="n">Map</span><span class="p">,</span> <span class="n">Rule</span>
 <span class="gp">&gt;&gt;&gt; </span><span class="n">m</span> <span class="o">=</span> <span class="n">Map</span><span class="p">([</span>
 <span class="gp">... </span>    <span class="n">Rule</span><span class="p">(</span><span class="s">&#39;/&#39;</span><span class="p">,</span> <span class="n">endpoint</span><span class="o">=</span><span class="s">&#39;index&#39;</span><span class="p">),</span>
 <span class="gp">... </span>    <span class="n">Rule</span><span class="p">(</span><span class="s">&#39;/downloads/&#39;</span><span class="p">,</span> <span class="n">endpoint</span><span class="o">=</span><span class="s">&#39;downloads/index&#39;</span><span class="p">),</span>
 error messages you can pass it <tt class="docutils literal"><span class="pre">catch_http_exceptions=True</span></tt> and
 it will catch the http exceptions.</p>
 <p>Here a small example for the dispatch usage:</p>
-<div class="syntax"><pre><span class="k">from</span> <span class="nn">werkzeug</span> <span class="k">import</span> <span class="n">Request</span><span class="p">,</span> <span class="n">Response</span><span class="p">,</span> <span class="n">responder</span>
-<span class="k">from</span> <span class="nn">werkzeug.routing</span> <span class="k">import</span> <span class="n">Map</span><span class="p">,</span> <span class="n">Rule</span>
+<div class="syntax"><pre><span class="kn">from</span> <span class="nn">werkzeug</span> <span class="kn">import</span> <span class="n">Request</span><span class="p">,</span> <span class="n">Response</span><span class="p">,</span> <span class="n">responder</span>
+<span class="kn">from</span> <span class="nn">werkzeug.routing</span> <span class="kn">import</span> <span class="n">Map</span><span class="p">,</span> <span class="n">Rule</span>
 
 <span class="k">def</span> <span class="nf">on_index</span><span class="p">(</span><span class="n">request</span><span class="p">):</span>
     <span class="k">return</span> <span class="n">Response</span><span class="p">(</span><span class="s">&#39;Hello from the index&#39;</span><span class="p">)</span>
 <dd><p class="first">Returns copies of the rules wrapped and expands string templates in
 the endpoint, rule, defaults or subdomain sections.</p>
 <p>Here a small example for such a rule template:</p>
-<div class="syntax"><pre><span class="k">from</span> <span class="nn">werkzeug.routing</span> <span class="k">import</span> <span class="n">Map</span><span class="p">,</span> <span class="n">Rule</span><span class="p">,</span> <span class="n">RuleTemplate</span>
+<div class="syntax"><pre><span class="kn">from</span> <span class="nn">werkzeug.routing</span> <span class="kn">import</span> <span class="n">Map</span><span class="p">,</span> <span class="n">Rule</span><span class="p">,</span> <span class="n">RuleTemplate</span>
 
 <span class="n">resource</span> <span class="o">=</span> <span class="n">RuleTemplate</span><span class="p">([</span>
     <span class="n">Rule</span><span class="p">(</span><span class="s">&#39;/$name/&#39;</span><span class="p">,</span> <span class="n">endpoint</span><span class="o">=</span><span class="s">&#39;$name.list&#39;</span><span class="p">),</span>
 subclass <cite>BaseConverter</cite> and pass that new converter to the url_map.  A converter
 has to provide two public methods: <cite>to_python</cite> and <cite>to_url</cite>, as well as a
 member that represents a regular expression.  Here is a small example:</p>
-<div class="syntax"><pre><span class="k">from</span> <span class="nn">random</span> <span class="k">import</span> <span class="n">randrange</span>
-<span class="k">from</span> <span class="nn">werkzeug.routing</span> <span class="k">import</span> <span class="n">Rule</span><span class="p">,</span> <span class="n">Map</span><span class="p">,</span> <span class="n">BaseConverter</span><span class="p">,</span> <span class="n">ValidationError</span>
+<div class="syntax"><pre><span class="kn">from</span> <span class="nn">random</span> <span class="kn">import</span> <span class="n">randrange</span>
+<span class="kn">from</span> <span class="nn">werkzeug.routing</span> <span class="kn">import</span> <span class="n">Rule</span><span class="p">,</span> <span class="n">Map</span><span class="p">,</span> <span class="n">BaseConverter</span><span class="p">,</span> <span class="n">ValidationError</span>
 
 <span class="k">class</span> <span class="nc">BooleanConverter</span><span class="p">(</span><span class="n">BaseConverter</span><span class="p">):</span>
 

File docs/build/script.html

 <p>The following snippet is roughly the same in every werkzeug script:</p>
 <div class="syntax"><pre><span class="c">#!/usr/bin/env python</span>
 <span class="c"># -*- coding: utf-8 -*-</span>
-<span class="k">from</span> <span class="nn">werkzeug</span> <span class="k">import</span> <span class="n">script</span>
+<span class="kn">from</span> <span class="nn">werkzeug</span> <span class="kn">import</span> <span class="n">script</span>
 
 <span class="c"># actions go here</span>
 
 <p>Because a runserver and shell command is pretty common there are two
 factory functions that create such commands:</p>
 <div class="syntax"><pre><span class="k">def</span> <span class="nf">make_app</span><span class="p">():</span>
-    <span class="k">from</span> <span class="nn">yourapplication</span> <span class="k">import</span> <span class="n">YourApplication</span>
+    <span class="kn">from</span> <span class="nn">yourapplication</span> <span class="kn">import</span> <span class="n">YourApplication</span>
     <span class="k">return</span> <span class="n">YourApplication</span><span class="p">(</span><span class="o">...</span><span class="p">)</span>
 
 <span class="n">action_runserver</span> <span class="o">=</span> <span class="n">script</span><span class="o">.</span><span class="n">make_runserver</span><span class="p">(</span><span class="n">make_app</span><span class="p">,</span> <span class="n">use_reloader</span><span class="o">=</span><span class="bp">True</span><span class="p">)</span>

File docs/build/serving.html

 <div class="syntax"><pre><span class="c">#!/usr/bin/env python</span>
 <span class="c"># -*- coding: utf-8 -*-</span>
 
-<span class="k">from</span> <span class="nn">werkzeug</span> <span class="k">import</span> <span class="n">run_simple</span>
-<span class="k">from</span> <span class="nn">myproject</span> <span class="k">import</span> <span class="n">make_app</span>
+<span class="kn">from</span> <span class="nn">werkzeug</span> <span class="kn">import</span> <span class="n">run_simple</span>
+<span class="kn">from</span> <span class="nn">myproject</span> <span class="kn">import</span> <span class="n">make_app</span>
 
 <span class="n">app</span> <span class="o">=</span> <span class="n">make_app</span><span class="p">(</span><span class="o">...</span><span class="p">)</span>
 <span class="n">run_simple</span><span class="p">(</span><span class="s">&#39;localhost&#39;</span><span class="p">,</span> <span class="mf">8080</span><span class="p">,</span> <span class="n">app</span><span class="p">,</span> <span class="n">use_reloader</span><span class="o">=</span><span class="bp">True</span><span class="p">)</span>

File docs/build/test.html

 wrapper returns a tuple.  Because response objects have the same signature,
 you can use them as response wrapper, ideally by subclassing them and hooking
 in test functionality.</p>
-<div class="syntax"><pre><span class="gp">&gt;&gt;&gt; </span><span class="k">from</span> <span class="nn">werkzeug</span> <span class="k">import</span> <span class="n">Client</span><span class="p">,</span> <span class="n">BaseResponse</span><span class="p">,</span> <span class="n">test_app</span>
+<div class="syntax"><pre><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">werkzeug</span> <span class="kn">import</span> <span class="n">Client</span><span class="p">,</span> <span class="n">BaseResponse</span><span class="p">,</span> <span class="n">test_app</span>
 <span class="gp">&gt;&gt;&gt; </span><span class="n">c</span> <span class="o">=</span> <span class="n">Client</span><span class="p">(</span><span class="n">test_app</span><span class="p">,</span> <span class="n">BaseResponse</span><span class="p">)</span>
 <span class="gp">&gt;&gt;&gt; </span><span class="n">resp</span> <span class="o">=</span> <span class="n">c</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s">&#39;/&#39;</span><span class="p">)</span>
 <span class="gp">&gt;&gt;&gt; </span><span class="n">resp</span><span class="o">.</span><span class="n">status_code</span>
 <span class="go">200</span>
 <span class="gp">&gt;&gt;&gt; </span><span class="n">resp</span><span class="o">.</span><span class="n">headers</span>
 <span class="go">Headers([(&#39;Content-Type&#39;, &#39;text/html; charset=utf-8&#39;)])</span>
-<span class="gp">&gt;&gt;&gt; </span><span class="n">resp</span><span class="o">.</span><span class="n">response_body</span><span class="o">.</span><span class="n">splitlines</span><span class="p">()[:</span><span class="mf">2</span><span class="p">]</span>
+<span class="gp">&gt;&gt;&gt; </span><span class="n">resp</span><span class="o">.</span><span class="n">data</span><span class="o">.</span><span class="n">splitlines</span><span class="p">()[:</span><span class="mf">2</span><span class="p">]</span>
 <span class="go">[&#39;&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.01 Transitional//EN&quot;&#39;,</span>
 <span class="go"> &#39;  &quot;http://www.w3.org/TR/html4/loose.dtd&quot;&gt;&#39;]</span>
 </pre></div>

File docs/build/tutorial.html

 files etc.).</p>
 <p>Here the initial code for our <tt class="docutils literal"><span class="pre">shorty/application.py</span></tt> file which implements
 the WSGI application:</p>
-<div class="syntax"><pre><span class="k">from</span> <span class="nn">sqlalchemy</span> <span class="k">import</span> <span class="n">create_engine</span>
-<span class="k">from</span> <span class="nn">werkzeug</span> <span class="k">import</span> <span class="n">Request</span><span class="p">,</span> <span class="n">ClosingIterator</span>
-<span class="k">from</span> <span class="nn">werkzeug.exceptions</span> <span class="k">import</span> <span class="n">HTTPException</span>
+<div class="syntax"><pre><span class="kn">from</span> <span class="nn">sqlalchemy</span> <span class="kn">import</span> <span class="n">create_engine</span>
+<span class="kn">from</span> <span class="nn">werkzeug</span> <span class="kn">import</span> <span class="n">Request</span><span class="p">,</span> <span class="n">ClosingIterator</span>
+<span class="kn">from</span> <span class="nn">werkzeug.exceptions</span> <span class="kn">import</span> <span class="n">HTTPException</span>
 
-<span class="k">from</span> <span class="nn">shorty.utils</span> <span class="k">import</span> <span class="n">session</span><span class="p">,</span> <span class="n">metadata</span><span class="p">,</span> <span class="n">local</span><span class="p">,</span> <span class="n">local_manager</span><span class="p">,</span> <span class="n">url_map</span>
-<span class="k">from</span> <span class="nn">shorty</span> <span class="k">import</span> <span class="n">views</span>
-<span class="k">import</span> <span class="nn">shorty.models</span>
+<span class="kn">from</span> <span class="nn">shorty.utils</span> <span class="kn">import</span> <span class="n">session</span><span class="p">,</span> <span class="n">metadata</span><span class="p">,</span> <span class="n">local</span><span class="p">,</span> <span class="n">local_manager</span><span class="p">,</span> <span class="n">url_map</span>
+<span class="kn">from</span> <span class="nn">shorty</span> <span class="kn">import</span> <span class="n">views</span>
+<span class="kn">import</span> <span class="nn">shorty.models</span>
 
 
 <span class="k">class</span> <span class="nc">Shorty</span><span class="p">(</span><span class="nb">object</span><span class="p">):</span>
 some more code into our utiliy module so that the imports work.  For the time
 being we just add the objects which we need for the application to work.  All
 the following code goes into the <tt class="docutils literal"><span class="pre">shorty/utils.py</span></tt> file:</p>
-<div class="syntax"><pre><span class="k">from</span> <span class="nn">sqlalchemy</span> <span class="k">import</span> <span class="n">MetaData</span>
-<span class="k">from</span> <span class="nn">sqlalchemy.orm</span> <span class="k">import</span> <span class="n">create_session</span><span class="p">,</span> <span class="n">scoped_session</span>
-<span class="k">from</span> <span class="nn">werkzeug</span> <span class="k">import</span> <span class="n">Local</span><span class="p">,</span> <span class="n">LocalManager</span>
-<span class="k">from</span> <span class="nn">werkzeug.routing</span> <span class="k">import</span> <span class="n">Map</span><span class="p">,</span> <span class="n">Rule</span>
+<div class="syntax"><pre><span class="kn">from</span> <span class="nn">sqlalchemy</span> <span class="kn">import</span> <span class="n">MetaData</span>
+<span class="kn">from</span> <span class="nn">sqlalchemy.orm</span> <span class="kn">import</span> <span class="n">create_session</span><span class="p">,</span> <span class="n">scoped_session</span>
+<span class="kn">from</span> <span class="nn">werkzeug</span> <span class="kn">import</span> <span class="n">Local</span><span class="p">,</span> <span class="n">LocalManager</span>
+<span class="kn">from</span> <span class="nn">werkzeug.routing</span> <span class="kn">import</span> <span class="n">Map</span><span class="p">,</span> <span class="n">Rule</span>
 
 <span class="n">local</span> <span class="o">=</span> <span class="n">Local</span><span class="p">()</span>
 <span class="n">local_manager</span> <span class="o">=</span> <span class="n">LocalManager</span><span class="p">([</span><span class="n">local</span><span class="p">])</span>
 following piece of code implements a fully featured management script.  Put
 it into the <cite>manage.py</cite> file you have created in the beginning:</p>
 <div class="syntax"><pre><span class="c">#!/usr/bin/env python</span>
-<span class="k">from</span> <span class="nn">werkzeug</span> <span class="k">import</span> <span class="n">script</span>
+<span class="kn">from</span> <span class="nn">werkzeug</span> <span class="kn">import</span> <span class="n">script</span>
 
 <span class="k">def</span> <span class="nf">make_app</span><span class="p">():</span>
-    <span class="k">from</span> <span class="nn">shorty.application</span> <span class="k">import</span> <span class="n">Shorty</span>
+    <span class="kn">from</span> <span class="nn">shorty.application</span> <span class="kn">import</span> <span class="n">Shorty</span>
     <span class="k">return</span> <span class="n">Shorty</span><span class="p">(</span><span class="s">&#39;sqlite:////tmp/shorty.db&#39;</span><span class="p">)</span>
 
 <span class="k">def</span> <span class="nf">make_shell</span><span class="p">():</span>
-    <span class="k">from</span> <span class="nn">shorty</span> <span class="k">import</span> <span class="n">models</span><span class="p">,</span> <span class="n">utils</span>
+    <span class="kn">from</span> <span class="nn">shorty</span> <span class="kn">import</span> <span class="n">models</span><span class="p">,</span> <span class="n">utils</span>
     <span class="n">application</span> <span class="o">=</span> <span class="n">make_app</span><span class="p">()</span>
     <span class="k">return</span> <span class="nb">locals</span><span class="p">()</span>
 
 <h3 id="part-3-database-models">Part 3: Database Models</h3>
 <p>Now we can create the models.  Because the application is pretty simple we
 just have one model and table:</p>
-<div class="syntax"><pre><span class="k">from</span> <span class="nn">datetime</span> <span class="k">import</span> <span class="n">datetime</span>
-<span class="k">from</span> <span class="nn">sqlalchemy</span> <span class="k">import</span> <span class="n">Table</span><span class="p">,</span> <span class="n">Column</span><span class="p">,</span> <span class="n">String</span><span class="p">,</span> <span class="n">Boolean</span><span class="p">,</span> <span class="n">DateTime</span>
-<span class="k">from</span> <span class="nn">shorty.utils</span> <span class="k">import</span> <span class="n">session</span><span class="p">,</span> <span class="n">metadata</span><span class="p">,</span> <span class="n">url_for</span><span class="p">,</span> <span class="n">get_random_uid</span>
+<div class="syntax"><pre><span class="kn">from</span> <span class="nn">datetime</span> <span class="kn">import</span> <span class="n">datetime</span>
+<span class="kn">from</span> <span class="nn">sqlalchemy</span> <span class="kn">import</span> <span class="n">Table</span><span class="p">,</span> <span class="n">Column</span><span class="p">,</span> <span class="n">String</span><span class="p">,</span> <span class="n">Boolean</span><span class="p">,</span> <span class="n">DateTime</span>
+<span class="kn">from</span> <span class="nn">shorty.utils</span> <span class="kn">import</span> <span class="n">session</span><span class="p">,</span> <span class="n">metadata</span><span class="p">,</span> <span class="n">url_for</span><span class="p">,</span> <span class="n">get_random_uid</span>
 
 <span class="n">url_table</span> <span class="o">=</span> <span class="n">Table</span><span class="p">(</span><span class="s">&#39;urls&#39;</span><span class="p">,</span> <span class="n">metadata</span><span class="p">,</span>
     <span class="n">Column</span><span class="p">(</span><span class="s">&#39;uid&#39;</span><span class="p">,</span> <span class="n">String</span><span class="p">(</span><span class="mf">140</span><span class="p">),</span> <span class="n">primary_key</span><span class="o">=</span><span class="bp">True</span><span class="p">),</span>
 free to use.
 What&#8217;s missing is the <cite>get_random_uid</cite> function we have to add to the utils
 module:</p>
-<div class="syntax"><pre><span class="k">from</span> <span class="nn">random</span> <span class="k">import</span> <span class="n">sample</span><span class="p">,</span> <span class="n">randrange</span>
+<div class="syntax"><pre><span class="kn">from</span> <span class="nn">random</span> <span class="kn">import</span> <span class="n">sample</span><span class="p">,</span> <span class="n">randrange</span>
 
 <span class="n">URL_CHARS</span> <span class="o">=</span> <span class="s">&#39;abcdefghijkmpqrstuvwxyzABCDEFGHIJKLMNPQRST23456789&#39;</span>
 
 <p>Once that is done we can use <tt class="docutils literal"><span class="pre">python</span> <span class="pre">manage.py</span> <span class="pre">initdb</span></tt> to initialize the
 database and play around with the stuff using <tt class="docutils literal"><span class="pre">python</span> <span class="pre">manage.py</span> <span class="pre">shell</span></tt>:</p>
 <div class="syntax"><pre><span class="go">Interactive Werkzeug Shell</span>
-<span class="gp">&gt;&gt;&gt; </span><span class="k">from</span> <span class="nn">shorty.models</span> <span class="k">import</span> <span class="n">session</span><span class="p">,</span> <span class="n">URL</span>
+<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">shorty.models</span> <span class="kn">import</span> <span class="n">session</span><span class="p">,</span> <span class="n">URL</span>
 </pre></div>
 <p>Now we can add some URLs to the database:</p>
 <div class="syntax"><pre><span class="gp">&gt;&gt;&gt; </span><span class="n">urls</span> <span class="o">=</span> <span class="p">[</span><span class="n">URL</span><span class="p">(</span><span class="s">&#39;http://example.org/&#39;</span><span class="p">),</span> <span class="n">URL</span><span class="p">(</span><span class="s">&#39;http://localhost:5000/&#39;</span><span class="p">)]</span>
 <p>For the beginning we just create a view function for new URLs and a function
 that displays a message about a new link.  All that code goes into our still
 empty <tt class="docutils literal"><span class="pre">views.py</span></tt> file:</p>
-<div class="syntax"><pre><span class="k">from</span> <span class="nn">werkzeug</span> <span class="k">import</span> <span class="n">redirect</span>
-<span class="k">from</span> <span class="nn">werkzeug.exceptions</span> <span class="k">import</span> <span class="n">NotFound</span>
-<span class="k">from</span> <span class="nn">shorty.utils</span> <span class="k">import</span> <span class="n">session</span><span class="p">,</span> <span class="n">render_template</span><span class="p">,</span> <span class="n">expose</span><span class="p">,</span> <span class="n">validate_url</span><span class="p">,</span> \
+<div class="syntax"><pre><span class="kn">from</span> <span class="nn">werkzeug</span> <span class="kn">import</span> <span class="n">redirect</span>
+<span class="kn">from</span> <span class="nn">werkzeug.exceptions</span> <span class="kn">import</span> <span class="n">NotFound</span>
+<span class="kn">from</span> <span class="nn">shorty.utils</span> <span class="kn">import</span> <span class="n">session</span><span class="p">,</span> <span class="n">render_template</span><span class="p">,</span> <span class="n">expose</span><span class="p">,</span> <span class="n">validate_url</span><span class="p">,</span> \
      <span class="n">url_for</span>
-<span class="k">from</span> <span class="nn">shorty.models</span> <span class="k">import</span> <span class="n">URL</span>
+<span class="kn">from</span> <span class="nn">shorty.models</span> <span class="kn">import</span> <span class="n">URL</span>
 
 <span class="nd">@expose</span><span class="p">(</span><span class="s">&#39;/&#39;</span><span class="p">)</span>
 <span class="k">def</span> <span class="nf">new</span><span class="p">(</span><span class="n">request</span><span class="p">):</span>
 <p>And again we have imported two objects from the utils module that
 don&#8217;t exist yet.  One of those should render a jinja template into a response
 object, the other one validates a URL.  So let&#8217;s add those to <tt class="docutils literal"><span class="pre">utils.py</span></tt>:</p>
-<div class="syntax"><pre><span class="k">from</span> <span class="nn">os</span> <span class="k">import</span> <span class="n">path</span>
-<span class="k">from</span> <span class="nn">urlparse</span> <span class="k">import</span> <span class="n">urlparse</span>
-<span class="k">from</span> <span class="nn">werkzeug</span> <span class="k">import</span> <span class="n">Response</span>
-<span class="k">from</span> <span class="nn">jinja</span> <span class="k">import</span> <span class="n">Environment</span><span class="p">,</span> <span class="n">FileSystemLoader</span>
+<div class="syntax"><pre><span class="kn">from</span> <span class="nn">os</span> <span class="kn">import</span> <span class="n">path</span>
+<span class="kn">from</span> <span class="nn">urlparse</span> <span class="kn">import</span> <span class="n">urlparse</span>
+<span class="kn">from</span> <span class="nn">werkzeug</span> <span class="kn">import</span> <span class="n">Response</span>
+<span class="kn">from</span> <span class="nn">jinja</span> <span class="kn">import</span> <span class="n">Environment</span><span class="p">,</span> <span class="n">FileSystemLoader</span>
 
 <span class="n">ALLOWED_SCHEMES</span> <span class="o">=</span> <span class="n">frozenset</span><span class="p">([</span><span class="s">&#39;http&#39;</span><span class="p">,</span> <span class="s">&#39;https&#39;</span><span class="p">,</span> <span class="s">&#39;ftp&#39;</span><span class="p">,</span> <span class="s">&#39;ftps&#39;</span><span class="p">])</span>
 <span class="n">TEMPLATE_PATH</span> <span class="o">=</span> <span class="n">path</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">path</span><span class="o">.</span><span class="n">dirname</span><span class="p">(</span><span class="n">__file__</span><span class="p">),</span> <span class="s">&#39;templates&#39;</span><span class="p">)</span>
 and do some code refactoring there.</p>
 <p>First of all you have to add a new import and calculate the path to the
 static files:</p>
-<div class="syntax"><pre><span class="k">from</span> <span class="nn">os</span> <span class="k">import</span> <span class="n">path</span>
-<span class="k">from</span> <span class="nn">werkzeug</span> <span class="k">import</span> <span class="n">SharedDataMiddleware</span>
+<div class="syntax"><pre><span class="kn">from</span> <span class="nn">os</span> <span class="kn">import</span> <span class="n">path</span>
+<span class="kn">from</span> <span class="nn">werkzeug</span> <span class="kn">import</span> <span class="n">SharedDataMiddleware</span>
 
 <span class="n">STATIC_PATH</span> <span class="o">=</span> <span class="n">path</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">path</span><span class="o">.</span><span class="n">dirname</span><span class="p">(</span><span class="n">__file__</span><span class="p">),</span> <span class="s">&#39;static&#39;</span><span class="p">)</span>
 </pre></div>
 we print all URLs at once we have sooner or later an endless page that takes
 minutes to load.</p>
 <p>So let&#8217;s start by adding a <cite>Pagination</cite> class into our utils module:</p>
-<div class="syntax"><pre><span class="k">from</span> <span class="nn">werkzeug</span> <span class="k">import</span> <span class="n">cached_property</span>
+<div class="syntax"><pre><span class="kn">from</span> <span class="nn">werkzeug</span> <span class="kn">import</span> <span class="n">cached_property</span>
 
 <span class="k">class</span> <span class="nc">Pagination</span><span class="p">(</span><span class="nb">object</span><span class="p">):</span>
 
 template.</p>
 <p>Now we can import the <cite>Pagination</cite> class into our views module and add some
 code to the <cite>list</cite> function:</p>
-<div class="syntax"><pre><span class="k">from</span> <span class="nn">shorty.utils</span> <span class="k">import</span> <span class="n">Pagination</span>
+<div class="syntax"><pre><span class="kn">from</span> <span class="nn">shorty.utils</span> <span class="kn">import</span> <span class="n">Pagination</span>
 
 <span class="nd">@expose</span><span class="p">(</span><span class="s">&#39;/list/&#39;</span><span class="p">,</span> <span class="n">defaults</span><span class="o">=</span><span class="p">{</span><span class="s">&#39;page&#39;</span><span class="p">:</span> <span class="mf">1</span><span class="p">})</span>
 <span class="nd">@expose</span><span class="p">(</span><span class="s">&#39;/list/&lt;int:page&gt;&#39;</span><span class="p">)</span>
 </pre></div>
 <p>Then we have to go into our application module and import the <cite>NotFound</cite>
 exception:</p>
-<div class="syntax"><pre><span class="k">from</span> <span class="nn">werkzeug.exceptions</span> <span class="k">import</span> <span class="n">NotFound</span>
+<div class="syntax"><pre><span class="kn">from</span> <span class="nn">werkzeug.exceptions</span> <span class="kn">import</span> <span class="n">NotFound</span>
 </pre></div>
 <p>Finally we have to catch it and translate it into a response.  This except
 block goes right <strong>before</strong> the except block of the <cite>HTTPException</cite>:</p>

File docs/build/tutorial_de.html

 Anwendung sind (z.B. eine Session-Middleware).</p>
 <p>Hier zunächst einmal der Quellcode für unsere Datei <tt class="docutils literal"><span class="pre">shorty/application.py</span></tt>,
 in der wir die WSGI-Anwendung ablegen:</p>
-<div class="syntax"><pre><span class="k">from</span> <span class="nn">sqlalchemy</span> <span class="k">import</span> <span class="n">create_engine</span>
-<span class="k">from</span> <span class="nn">werkzeug</span> <span class="k">import</span> <span class="n">Request</span><span class="p">,</span> <span class="n">ClosingIterator</span>
-<span class="k">from</span> <span class="nn">werkzeug.exceptions</span> <span class="k">import</span> <span class="n">HTTPException</span>
+<div class="syntax"><pre><span class="kn">from</span> <span class="nn">sqlalchemy</span> <span class="kn">import</span> <span class="n">create_engine</span>
+<span class="kn">from</span> <span class="nn">werkzeug</span> <span class="kn">import</span> <span class="n">Request</span><span class="p">,</span> <span class="n">ClosingIterator</span>
+<span class="kn">from</span> <span class="nn">werkzeug.exceptions</span> <span class="kn">import</span> <span class="n">HTTPException</span>
 
-<span class="k">from</span> <span class="nn">shorty.utils</span> <span class="k">import</span> <span class="n">session</span><span class="p">,</span> <span class="n">metadata</span><span class="p">,</span> <span class="n">local</span><span class="p">,</span> <span class="n">local_manager</span><span class="p">,</span> <span class="n">url_map</span>
-<span class="k">from</span> <span class="nn">shorty</span> <span class="k">import</span> <span class="n">views</span>
-<span class="k">import</span> <span class="nn">shorty.models</span>
+<span class="kn">from</span> <span class="nn">shorty.utils</span> <span class="kn">import</span> <span class="n">session</span><span class="p">,</span> <span class="n">metadata</span><span class="p">,</span> <span class="n">local</span><span class="p">,</span> <span class="n">local_manager</span><span class="p">,</span> <span class="n">url_map</span>
+<span class="kn">from</span> <span class="nn">shorty</span> <span class="kn">import</span> <span class="n">views</span>
+<span class="kn">import</span> <span class="nn">shorty.models</span>
 
 
 <span class="k">class</span> <span class="nc">Shorty</span><span class="p">(</span><span class="nb">object</span><span class="p">):</span>
 das Utility-Modul noch um Code ergänzen, damit die Imports klappen.  Fürs Erste
 fügen wir nur die Objekte hinzu, die wir brauchen, damit die Applikation
 funktioniert.  Der folgende Code landet in der Datei <tt class="docutils literal"><span class="pre">shorty/utils.py</span></tt>:</p>
-<div class="syntax"><pre><span class="k">from</span> <span class="nn">sqlalchemy</span> <span class="k">import</span> <span class="n">MetaData</span>
-<span class="k">from</span> <span class="nn">sqlalchemy.orm</span> <span class="k">import</span> <span class="n">create_session</span><span class="p">,</span> <span class="n">scoped_session</span>
-<span class="k">from</span> <span class="nn">werkzeug</span> <span class="k">import</span> <span class="n">Local</span><span class="p">,</span> <span class="n">LocalManager</span>
-<span class="k">from</span> <span class="nn">werkzeug.routing</span> <span class="k">import</span> <span class="n">Map</span><span class="p">,</span> <span class="n">Rule</span>
+<div class="syntax"><pre><span class="kn">from</span> <span class="nn">sqlalchemy</span> <span class="kn">import</span> <span class="n">MetaData</span>
+<span class="kn">from</span> <span class="nn">sqlalchemy.orm</span> <span class="kn">import</span> <span class="n">create_session</span><span class="p">,</span> <span class="n">scoped_session</span>
+<span class="kn">from</span> <span class="nn">werkzeug</span> <span class="kn">import</span> <span class="n">Local</span><span class="p">,</span> <span class="n">LocalManager</span>
+<span class="kn">from</span> <span class="nn">werkzeug.routing</span> <span class="kn">import</span> <span class="n">Map</span><span class="p">,</span> <span class="n">Rule</span>
 
 <span class="n">local</span> <span class="o">=</span> <span class="n">Local</span><span class="p">()</span>
 <span class="n">local_manager</span> <span class="o">=</span> <span class="n">LocalManager</span><span class="p">([</span><span class="n">local</span><span class="p">])</span>
 Der folgende Code implementiert ein voll funktionsfähiges Verwaltungs-Script
 und gehört in die <cite>manage.py</cite>-Datei, welche du am Anfang erstellt hast:</p>
 <div class="syntax"><pre><span class="c">#!/usr/bin/env python</span>
-<span class="k">from</span> <span class="nn">werkzeug</span> <span class="k">import</span> <span class="n">script</span>
+<span class="kn">from</span> <span class="nn">werkzeug</span> <span class="kn">import</span> <span class="n">script</span>
 
 <span class="k">def</span> <span class="nf">make_app</span><span class="p">():</span>
-    <span class="k">from</span> <span class="nn">shorty.application</span> <span class="k">import</span> <span class="n">Shorty</span>
+    <span class="kn">from</span> <span class="nn">shorty.application</span> <span class="kn">import</span> <span class="n">Shorty</span>
     <span class="k">return</span> <span class="n">Shorty</span><span class="p">(</span><span class="s">&#39;sqlite:////tmp/shorty.db&#39;</span><span class="p">)</span>
 
 <span class="k">def</span> <span class="nf">make_shell</span><span class="p">():</span>
-    <span class="k">from</span> <span class="nn">shorty</span> <span class="k">import</span> <span class="n">models</span><span class="p">,</span> <span class="n">utils</span>
+    <span class="kn">from</span> <span class="nn">shorty</span> <span class="kn">import</span> <span class="n">models</span><span class="p">,</span> <span class="n">utils</span>
     <span class="n">application</span> <span class="o">=</span> <span class="n">make_app</span><span class="p">()</span>
     <span class="k">return</span> <span class="nb">locals</span><span class="p">()</span>
 
 <h3 id="teil-3-datenbank-models">Teil 3: Datenbank-Models</h3>
 <p>Jetzt können wir die Models erstellen.  Da die Anwendung ziemlich einfach ist,
 haben wir nur ein Model und eine Tabelle:</p>
-<div class="syntax"><pre><span class="k">from</span> <span class="nn">datetime</span> <span class="k">import</span> <span class="n">datetime</span>
-<span class="k">from</span> <span class="nn">sqlalchemy</span> <span class="k">import</span> <span class="n">Table</span><span class="p">,</span> <span class="n">Column</span><span class="p">,</span> <span class="n">String</span><span class="p">,</span> <span class="n">Boolean</span><span class="p">,</span> <span class="n">DateTime</span>
-<span class="k">from</span> <span class="nn">shorty.utils</span> <span class="k">import</span> <span class="n">session</span><span class="p">,</span> <span class="n">metadata</span><span class="p">,</span> <span class="n">url_for</span><span class="p">,</span> <span class="n">get_random_uid</span>
+<div class="syntax"><pre><span class="kn">from</span> <span class="nn">datetime</span> <span class="kn">import</span> <span class="n">datetime</span>
+<span class="kn">from</span> <span class="nn">sqlalchemy</span> <span class="kn">import</span> <span class="n">Table</span><span class="p">,</span> <span class="n">Column</span><span class="p">,</span> <span class="n">String</span><span class="p">,</span> <span class="n">Boolean</span><span class="p">,</span> <span class="n">DateTime</span>
+<span class="kn">from</span> <span class="nn">shorty.utils</span> <span class="kn">import</span> <span class="n">session</span><span class="p">,</span> <span class="n">metadata</span><span class="p">,</span> <span class="n">url_for</span><span class="p">,</span> <span class="n">get_random_uid</span>
 
 <span class="n">url_table</span> <span class="o">=</span> <span class="n">Table</span><span class="p">(</span><span class="s">&#39;urls&#39;</span><span class="p">,</span> <span class="n">metadata</span><span class="p">,</span>
     <span class="n">Column</span><span class="p">(</span><span class="s">&#39;uid&#39;</span><span class="p">,</span> <span class="n">String</span><span class="p">(</span><span class="mf">140</span><span class="p">),</span> <span class="n">primary_key</span><span class="o">=</span><span class="bp">True</span><span class="p">),</span>
 <p>Im Konstruktor generieren wir solange eine eindeutige ID, bis wir eine finden,
 die noch nicht belegt ist.  Die <cite>get_random_uid</cite>-Funktion fehlt &#8211; wir müssen
 sie noch in unser <cite>utils</cite>-Modul einfügen:</p>
-<div class="syntax"><pre><span class="k">from</span> <span class="nn">random</span> <span class="k">import</span> <span class="n">sample</span><span class="p">,</span> <span class="n">randrange</span>
+<div class="syntax"><pre><span class="kn">from</span> <span class="nn">random</span> <span class="kn">import</span> <span class="n">sample</span><span class="p">,</span> <span class="n">randrange</span>
 
 <span class="n">URL_CHARS</span> <span class="o">=</span> <span class="s">&#39;abcdefghijkmpqrstuvwxyzABCDEFGHIJKLMNPQRST23456789&#39;</span>
 
 <p>Wenn das getan ist, können wir <tt class="docutils literal"><span class="pre">python</span> <span class="pre">manage.py</span> <span class="pre">initdb</span></tt> ausführen, um die
 Datenbank zu erstellen und <tt class="docutils literal"><span class="pre">python</span> <span class="pre">manage.py</span> <span class="pre">shell</span></tt>, um damit herumzuspielen:</p>
 <div class="syntax"><pre><span class="go">Interactive Werkzeug Shell</span>
-<span class="gp">&gt;&gt;&gt; </span><span class="k">from</span> <span class="nn">shorty.models</span> <span class="k">import</span> <span class="n">session</span><span class="p">,</span> <span class="n">URL</span>
+<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">shorty.models</span> <span class="kn">import</span> <span class="n">session</span><span class="p">,</span> <span class="n">URL</span>
 </pre></div>
 <p>Jetzt können wir einige URLs zu der Datenbank hinzufügen:</p>
 <div class="syntax"><pre><span class="gp">&gt;&gt;&gt; </span><span class="n">urls</span> <span class="o">=</span> <span class="p">[</span><span class="n">URL</span><span class="p">(</span><span class="s">&#39;http://example.org/&#39;</span><span class="p">),</span> <span class="n">URL</span><span class="p">(</span><span class="s">&#39;http://localhost:5000/&#39;</span><span class="p">)]</span>
 <p>Als Anfang erstellen wir einfach eine View-Funktion für neue URLs und eine
 Funktion, die eine Nachricht über einen neuen Link darstellt.  Das wird der
 Inhalt unserer noch leeren <tt class="docutils literal"><span class="pre">views.py</span></tt>-Datei:</p>
-<div class="syntax"><pre><span class="k">from</span> <span class="nn">werkzeug</span> <span class="k">import</span> <span class="n">redirect</span>
-<span class="k">from</span> <span class="nn">werkzeug.exceptions</span> <span class="k">import</span> <span class="n">NotFound</span>
-<span class="k">from</span> <span class="nn">shorty.utils</span> <span class="k">import</span> <span class="n">session</span><span class="p">,</span> <span class="n">render_template</span><span class="p">,</span> <span class="n">expose</span><span class="p">,</span> <span class="n">validate_url</span><span class="p">,</span> \
+<div class="syntax"><pre><span class="kn">from</span> <span class="nn">werkzeug</span> <span class="kn">import</span> <span class="n">redirect</span>
+<span class="kn">from</span> <span class="nn">werkzeug.exceptions</span> <span class="kn">import</span> <span class="n">NotFound</span>
+<span class="kn">from</span> <span class="nn">shorty.utils</span> <span class="kn">import</span> <span class="n">session</span><span class="p">,</span> <span class="n">render_template</span><span class="p">,</span> <span class="n">expose</span><span class="p">,</span> <span class="n">validate_url</span><span class="p">,</span> \
      <span class="n">url_for</span>
-<span class="k">from</span> <span class="nn">shorty.models</span> <span class="k">import</span> <span class="n">URL</span>
+<span class="kn">from</span> <span class="nn">shorty.models</span> <span class="kn">import</span> <span class="n">URL</span>
 
 <span class="nd">@expose</span><span class="p">(</span><span class="s">&#39;/&#39;</span><span class="p">)</span>
 <span class="k">def</span> <span class="nf">new</span><span class="p">(</span><span class="n">request</span><span class="p">):</span>
 die jetzt noch nicht existieren.  Eines von diesen soll ein Jinja-Template in
 ein Response-Objekt verwandeln, das andere prüft eine URL.  Fügen wir also
 diese zu <tt class="docutils literal"><span class="pre">utils.py</span></tt> hinzu:</p>
-<div class="syntax"><pre><span class="k">from</span> <span class="nn">os</span> <span class="k">import</span> <span class="n">path</span>
-<span class="k">from</span> <span class="nn">urlparse</span> <span class="k">import</span> <span class="n">urlparse</span>
-<span class="k">from</span> <span class="nn">werkzeug</span> <span class="k">import</span> <span class="n">Response</span>
-<span class="k">from</span> <span class="nn">jinja</span> <span class="k">import</span> <span class="n">Environment</span><span class="p">,</span> <span class="n">FileSystemLoader</span>
+<div class="syntax"><pre><span class="kn">from</span> <span class="nn">os</span> <span class="kn">import</span> <span class="n">path</span>
+<span class="kn">from</span> <span class="nn">urlparse</span> <span class="kn">import</span> <span class="n">urlparse</span>
+<span class="kn">from</span> <span class="nn">werkzeug</span> <span class="kn">import</span> <span class="n">Response</span>
+<span class="kn">from</span> <span class="nn">jinja</span> <span class="kn">import</span> <span class="n">Environment</span><span class="p">,</span> <span class="n">FileSystemLoader</span>
 
 <span class="n">ALLOWED_SCHEMES</span> <span class="o">=</span> <span class="n">frozenset</span><span class="p">([</span><span class="s">&#39;http&#39;</span><span class="p">,</span> <span class="s">&#39;https&#39;</span><span class="p">,</span> <span class="s">&#39;ftp&#39;</span><span class="p">,</span> <span class="s">&#39;ftps&#39;</span><span class="p">])</span>
 <span class="n">TEMPLATE_PATH</span> <span class="o">=</span> <span class="n">path</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">path</span><span class="o">.</span><span class="n">dirname</span><span class="p">(</span><span class="n">__file__</span><span class="p">),</span> <span class="s">&#39;templates&#39;</span><span class="p">)</span>
 <tt class="docutils literal"><span class="pre">application.py</span></tt> und passen den Code ein wenig an.</p>
 <p>Als Erstes musst du einen neuen Import hinzufügen und den Pfad zu den
 statischen Dateien ermitteln:</p>
-<div class="syntax"><pre><span class="k">from</span> <span class="nn">os</span> <span class="k">import</span> <span class="n">path</span>
-<span class="k">from</span> <span class="nn">werkzeug</span> <span class="k">import</span> <span class="n">SharedDataMiddleware</span>
+<div class="syntax"><pre><span class="kn">from</span> <span class="nn">os</span> <span class="kn">import</span> <span class="n">path</span>
+<span class="kn">from</span> <span class="nn">werkzeug</span> <span class="kn">import</span> <span class="n">SharedDataMiddleware</span>
 
 <span class="n">STATIC_PATH</span> <span class="o">=</span> <span class="n">path</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">path</span><span class="o">.</span><span class="n">dirname</span><span class="p">(</span><span class="n">__file__</span><span class="p">),</span> <span class="s">&#39;static&#39;</span><span class="p">)</span>
 </pre></div>
 eine endlose Seite, die Minuten zum Laden benötigt.</p>
 <p>Beginnen wir also mit dem Hinzufügen einer <cite>Pagination</cite>-Klasse zu unserem
 <cite>utils</cite>-Modul:</p>
-<div class="syntax"><pre><span class="k">from</span> <span class="nn">werkzeug</span> <span class="k">import</span> <span class="n">cached_property</span>
+<div class="syntax"><pre><span class="kn">from</span> <span class="nn">werkzeug</span> <span class="kn">import</span> <span class="n">cached_property</span>
 
 <span class="k">class</span> <span class="nc">Pagination</span><span class="p">(</span><span class="nb">object</span><span class="p">):</span>
 
 nutzen können.</p>
 <p>Jetzt können wir die <cite>Pagination</cite>-Klasse in unser Views-Modul importieren und
 etwas Code zu der <cite>list</cite>-Funktion hinzufügen:</p>
-<div class="syntax"><pre><span class="k">from</span> <span class="nn">shorty.utils</span> <span class="k">import</span> <span class="n">Pagination</span>
+<div class="syntax"><pre><span class="kn">from</span> <span class="nn">shorty.utils</span> <span class="kn">import</span> <span class="n">Pagination</span>
 
 <span class="nd">@expose</span><span class="p">(</span><span class="s">&#39;/list/&#39;</span><span class="p">,</span> <span class="n">defaults</span><span class="o">=</span><span class="p">{</span><span class="s">&#39;page&#39;</span><span class="p">:</span> <span class="mf">1</span><span class="p">})</span>
 <span class="nd">@expose</span><span class="p">(</span><span class="s">&#39;/list/&lt;int:page&gt;&#39;</span><span class="p">)</span>
 </pre></div>
 <p>Dann müssen wir in unser Anwendungsmodul wechseln und die <cite>NotFound</cite>-Exception
 importieren:</p>
-<div class="syntax"><pre><span class="k">from</span> <span class="nn">werkzeug.exceptions</span> <span class="k">import</span> <span class="n">NotFound</span>
+<div class="syntax"><pre><span class="kn">from</span> <span class="nn">werkzeug.exceptions</span> <span class="kn">import</span> <span class="n">NotFound</span>
 </pre></div>
 <p>Schließlich müssen wir sie auffangen und in eine Response umwandeln.  Dieser
 except-Block kommt <strong>vor</strong> den except-Bock mit <cite>HTTPException</cite>:</p>

File docs/build/utils.html

 <dd><p class="first">A read only <cite>MultiDict</cite> decorator that you can pass multiple <cite>MultiDict</cite>
 instances as sequence and it will combine the return values of all wrapped
 dicts:</p>
-<div class="syntax"><pre><span class="gp">&gt;&gt;&gt; </span><span class="k">from</span> <span class="nn">werkzeug</span> <span class="k">import</span> <span class="n">MultiDict</span><span class="p">,</span> <span class="n">CombinedMultiDict</span>
+<div class="syntax"><pre><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">werkzeug</span> <span class="kn">import</span> <span class="n">MultiDict</span><span class="p">,</span> <span class="n">CombinedMultiDict</span>
 <span class="gp">&gt;&gt;&gt; </span><span class="n">post</span> <span class="o">=</span> <span class="n">MultiDict</span><span class="p">([(</span><span class="s">&#39;foo&#39;</span><span class="p">,</span> <span class="s">&#39;bar&#39;</span><span class="p">)])</span>
 <span class="gp">&gt;&gt;&gt; </span><span class="n">get</span> <span class="o">=</span> <span class="n">MultiDict</span><span class="p">([(</span><span class="s">&#39;blub&#39;</span><span class="p">,</span> <span class="s">&#39;blah&#39;</span><span class="p">)])</span>
 <span class="gp">&gt;&gt;&gt; </span><span class="n">combined</span> <span class="o">=</span> <span class="n">CombinedMultiDict</span><span class="p">([</span><span class="n">get</span><span class="p">,</span> <span class="n">post</span><span class="p">])</span>
 <dd>add a new header tuple to the list</dd>
 </dl>
 <dl>
+<dt><cite id="werkzeug.utils.Headers.pop">pop</cite> <tt class="func-signature docutils literal"><span class="pre">(key=None,</span> <span class="pre">default=&lt;object</span> <span class="pre">object</span> <span class="pre">at</span> <span class="pre">0x523488&gt;)</span></tt></dt>
+<dd>Removes a key or index.</dd>
+</dl>
+<dl>
 <dt><cite id="werkzeug.utils.Headers.set">set</cite> <tt class="func-signature docutils literal"><span class="pre">(key,</span> <span class="pre">value)</span></tt></dt>
-<dd>remove all header tuples for key and add
-a new one</dd>
+<dd>remove all header tuples for key and add a new one.  The newly
+added key either appears at the end of the list if there was no
+entry or replaces the first one.</dd>
 </dl>
 <dl>
 <dt><cite id="werkzeug.utils.Headers.extend">extend</cite> <tt class="func-signature docutils literal"><span class="pre">(iterable)</span></tt></dt>
 to subclass it and add your own items have a look at the sourcecode for
 that class.</p>
 <p>The following attributes are exposed:</p>
-<p class="last"><cite>no_cache</cite>, <cite>no_store</cite>, <cite>max_age</cite>, <cite>max_stale</cite>, <cite>min_fresh</cite>,
+<p><cite>no_cache</cite>, <cite>no_store</cite>, <cite>max_age</cite>, <cite>max_stale</cite>, <cite>min_fresh</cite>,
 <cite>no_transform</cite>, <cite>only_if_cached</cite>, <cite>public</cite>, <cite>private</cite>, <cite>must_revalidate</cite>,
 <cite>proxy_revalidate</cite>, and <cite>s_maxage</cite></p>
+<p>The behavior of this class changed slightly from 0.3 to 0.4.  Since 0.4
+setting <cite>no_cache</cite> or <cite>private</cite> to boolean <cite>True</cite> will set the implicit
+none-value which is <tt class="docutils literal"><span class="pre">*</span></tt>:</p>
+<div class="syntax"><pre><span class="gp">&gt;&gt;&gt; </span><span class="n">cc</span> <span class="o">=</span> <span class="n">CacheControl</span><span class="p">()</span>
+<span class="gp">&gt;&gt;&gt; </span><span class="n">cc</span><span class="o">.</span><span class="n">no_cache</span> <span class="o">=</span> <span class="bp">True</span>
+<span class="gp">&gt;&gt;&gt; </span><span class="n">cc</span>
+<span class="go">&lt;CacheControl &#39;no-cache&#39;&gt;</span>
+<span class="gp">&gt;&gt;&gt; </span><span class="n">cc</span><span class="o">.</span><span class="n">no_cache</span>
+<span class="go">&#39;*&#39;</span>
+<span class="gp">&gt;&gt;&gt; </span><span class="n">cc</span><span class="o">.</span><span class="n">no_cache</span> <span class="o">=</span> <span class="bp">None</span>
+<span class="gp">&gt;&gt;&gt; </span><span class="n">cc</span>
+<span class="go">&lt;CacheControl &#39;&#39;&gt;</span>
+</pre></div>
 </dd>
 </dl>
 <dl>
 the first trailing underscore of the parameter name:</p>
 <div class="syntax"><pre><span class="gp">&gt;&gt;&gt; </span><span class="n">href</span><span class="p">(</span><span class="n">is_</span><span class="o">=</span><span class="mf">42</span><span class="p">)</span>
 <span class="go">&#39;/foo?is=42&#39;</span>
+<span class="gp">&gt;&gt;&gt; </span><span class="n">href</span><span class="p">({</span><span class="s">&#39;foo&#39;</span><span class="p">:</span> <span class="s">&#39;bar&#39;</span><span class="p">})</span>
+<span class="go">&#39;/foo?foo=bar&#39;</span>
+</pre></div>
+<p>Combining of both methods is not allowed:</p>
+<div class="syntax"><pre><span class="gp">&gt;&gt;&gt; </span><span class="n">href</span><span class="p">({</span><span class="s">&#39;foo&#39;</span><span class="p">:</span> <span class="s">&#39;bar&#39;</span><span class="p">},</span> <span class="n">bar</span><span class="o">=</span><span class="mf">42</span><span class="p">)</span>
+<span class="gt">Traceback (most recent call last):</span>
+  <span class="c">...</span>
+<span class="nc">TypeError</span>: <span class="n-Identifier">keyword arguments and query-dicts can&#39;t be combined</span>
 </pre></div>
 <p>Accessing attributes on the href object creates a new href object with
 the attribute name as prefix:</p>
 <dt><strong>class</strong> <cite id="werkzeug.utils.SharedDataMiddleware">SharedDataMiddleware</cite></dt>
 <dd><p class="first">A WSGI middleware that provides static content for development
 environments or simple server setups. Usage is quite simple:</p>
-<div class="syntax"><pre><span class="k">import</span> <span class="nn">os</span>
-<span class="k">from</span> <span class="nn">werkzeug</span> <span class="k">import</span> <span class="n">SharedDataMiddleware</span>
+<div class="syntax"><pre><span class="kn">import</span> <span class="nn">os</span>
+<span class="kn">from</span> <span class="nn">werkzeug</span> <span class="kn">import</span> <span class="n">SharedDataMiddleware</span>
 
 <span class="n">app</span> <span class="o">=</span> <span class="n">SharedDataMiddleware</span><span class="p">(</span><span class="n">app</span><span class="p">,</span> <span class="p">{</span>
     <span class="s">&#39;/shared&#39;</span><span class="p">:</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">dirname</span><span class="p">(</span><span class="n">__file__</span><span class="p">),</span> <span class="s">&#39;shared&#39;</span><span class="p">)</span>
 </dl>
 <p>This can be useful for decorators that forward user submitted data to
 a view function:</p>
-<div class="syntax"><pre><span class="k">from</span> <span class="nn">werkzeug</span> <span class="k">import</span> <span class="n">ArgumentValidationError</span><span class="p">,</span> <span class="n">validate_arguments</span>
+<div class="syntax"><pre><span class="kn">from</span> <span class="nn">werkzeug</span> <span class="kn">import</span> <span class="n">ArgumentValidationError</span><span class="p">,</span> <span class="n">validate_arguments</span>
 
 <span class="k">def</span> <span class="nf">sanitize</span><span class="p">(</span><span class="n">f</span><span class="p">):</span>
     <span class="k">def</span> <span class="nf">proxy</span><span class="p">(</span><span class="n">request</span><span class="p">):</span>

File docs/build/wrappers.html

 <p>It&#8217;s a good idea to create a custom subclass of the <cite>BaseRequest</cite> and add
 missing functionality either via mixins or direct implementation.  Here
 an example for such subclasses:</p>
-<div class="syntax"><pre><span class="k">from</span> <span class="nn">werkzeug</span> <span class="k">import</span> <span class="n">BaseRequest</span><span class="p">,</span> <span class="n">ETagRequestMixin</span>
+<div class="syntax"><pre><span class="kn">from</span> <span class="nn">werkzeug</span> <span class="kn">import</span> <span class="n">BaseRequest</span><span class="p">,</span> <span class="n">ETagRequestMixin</span>
 
 <span class="k">class</span> <span class="nc">Request</span><span class="p">(</span><span class="n">BaseRequest</span><span class="p">,</span> <span class="n">ETagRequestMixin</span><span class="p">):</span>
     <span class="k">pass</span>
 because they can catch all the exceptions before responses are started.</p>
 <p>Here a small example WSGI application that takes advantage of the
 response objects:</p>
-<div class="syntax"><pre><span class="k">from</span> <span class="nn">werkzeug</span> <span class="k">import</span> <span class="n">BaseResponse</span> <span class="k">as</span> <span class="n">Response</span>
+<div class="syntax"><pre><span class="kn">from</span> <span class="nn">werkzeug</span> <span class="kn">import</span> <span class="n">BaseResponse</span> <span class="k">as</span> <span class="n">Response</span>
 
 <span class="k">def</span> <span class="nf">index</span><span class="p">():</span>
     <span class="k">return</span> <span class="n">Response</span><span class="p">(</span><span class="s">&#39;Index page&#39;</span><span class="p">)</span>
 mix those classes in to extend the functionality of the <cite>BaseRequest</cite> or
 <cite>BaseResponse</cite> object.  Here a small example for a request object that
 parses accept headers:</p>
-<div class="syntax"><pre><span class="k">from</span> <span class="nn">werkzeug</span> <span class="k">import</span> <span class="n">BaseRequest</span><span class="p">,</span> <span class="n">AcceptMixin</span>
+<div class="syntax"><pre><span class="kn">from</span> <span class="nn">werkzeug</span> <span class="kn">import</span> <span class="n">BaseRequest</span><span class="p">,</span> <span class="n">AcceptMixin</span>
 
 <span class="k">class</span> <span class="nc">Request</span><span class="p">(</span><span class="n">BaseRequest</span><span class="p">,</span> <span class="n">AcceptMixin</span><span class="p">):</span>
     <span class="k">pass</span>
 </dl>
 </dd>
 </dl>
+<dl>
+<dt><strong>class</strong> <cite id="werkzeug.wrappers.UserAgentMixin">UserAgentMixin</cite></dt>
+<dd><p class="first">Adds a <cite>user_agent</cite> attribute to the request object which contains the
+parsed user agent of the browser that triggered the request as <cite>UserAgent</cite>
+object.</p>
+<dl class="last">
+<dt><cite id="werkzeug.wrappers.UserAgentMixin.user_agent">user_agent</cite></dt>
+<dd>The current user agent.</dd>
+</dl>
+</dd>
+</dl>
 </div>
 <div class="section">
 <h3 id="note-on-file-uploads">Note on File Uploads</h3>

File docs/build/wsgihowto.html

 <p>To start the application as standalone server, all you have to do is adding
 this start hook to the file:</p>
 <div class="syntax"><pre><span class="k">if</span> <span class="n">__name__</span> <span class="o">==</span> <span class="s">&#39;__main__&#39;</span><span class="p">:</span>
-    <span class="k">from</span> <span class="nn">wsgiref.simple_server</span> <span class="k">import</span> <span class="n">make_server</span>
+    <span class="kn">from</span> <span class="nn">wsgiref.simple_server</span> <span class="kn">import</span> <span class="n">make_server</span>
     <span class="n">srv</span> <span class="o">=</span> <span class="n">make_server</span><span class="p">(</span><span class="s">&#39;localhost&#39;</span><span class="p">,</span> <span class="mf">5000</span><span class="p">,</span> <span class="n">application</span><span class="p">)</span>
     <span class="n">srv</span><span class="o">.</span><span class="n">serve_forever</span><span class="p">()</span>
 </pre></div>
 <h3 id="adding-interactive-elements">Adding Interactive Elements</h3>
 <p>Let&#8217;s extend the example from above so that we say <tt class="docutils literal"><span class="pre">Hello</span> <span class="pre">John</span></tt> if the user
 visits <tt class="docutils literal"><span class="pre">http://localhost:5000/?name=John</span></tt>:</p>
-<div class="syntax"><pre><span class="k">from</span> <span class="nn">cgi</span> <span class="k">import</span> <span class="n">parse_qs</span><span class="p">,</span> <span class="n">escape</span>
+<div class="syntax"><pre><span class="kn">from</span> <span class="nn">cgi</span> <span class="kn">import</span> <span class="n">parse_qs</span><span class="p">,</span> <span class="n">escape</span>
 
 <span class="k">def</span> <span class="nf">application</span><span class="p">(</span><span class="n">environ</span><span class="p">,</span> <span class="n">start_response</span><span class="p">):</span>
     <span class="n">start_response</span><span class="p">(</span><span class="s">&#39;200 OK&#39;</span><span class="p">,</span> <span class="p">[(</span><span class="s">&#39;Content-Type&#39;</span><span class="p">,</span> <span class="s">&#39;text/html&#39;</span><span class="p">)])</span>
 with an about function, both returning different content.  To keep the example
 simple we just want to use a dict that maps to that and take advantage or some
 of the Werkzeug features:</p>
-<div class="syntax"><pre><span class="k">from</span> <span class="nn">werkzeug</span> <span class="k">import</span> <span class="n">Request</span><span class="p">,</span> <span class="n">Response</span><span class="p">,</span> <span class="n">escape</span>
+<div class="syntax"><pre><span class="kn">from</span> <span class="nn">werkzeug</span> <span class="kn">import</span> <span class="n">Request</span><span class="p">,</span> <span class="n">Response</span><span class="p">,</span> <span class="n">escape</span>
 
 <span class="k">def</span> <span class="nf">index</span><span class="p">(</span><span class="n">req</span><span class="p">):</span>
     <span class="k">return</span> <span class="n">Response</span><span class="p">(</span><span class="s">u&#39;&#39;&#39;&lt;h1&gt;Index Page&lt;/h1&gt;</span>
     <span class="k">return</span> <span class="n">resp</span><span class="p">(</span><span class="n">environ</span><span class="p">,</span> <span class="n">start_response</span><span class="p">)</span>
 
 <span class="k">if</span> <span class="n">__name__</span> <span class="o">==</span> <span class="s">&#39;__main__&#39;</span><span class="p">:</span>
-    <span class="k">from</span> <span class="nn">werkzeug</span> <span class="k">import</span> <span class="n">run_simple</span>
+    <span class="kn">from</span> <span class="nn">werkzeug</span> <span class="kn">import</span> <span class="n">run_simple</span>
     <span class="n">run_simple</span><span class="p">(</span><span class="s">&#39;localhost&#39;</span><span class="p">,</span> <span class="mf">5000</span><span class="p">,</span> <span class="n">application</span><span class="p">)</span>
 </pre></div>
 <p>Alright. That&#8217;s quite a lot of code but let&#8217;s go through it step-by-step.</p>