Commits

Anonymous committed 40e894d

We're ready for the 0.3 release.

Comments (0)

Files changed (17)

-include Makefile CHANGES LICENSE AUTHORS TODO ez_setup.py
-recursive-include werkzeug debug/shared/*
+include Makefile THANKS CHANGES LICENSE AUTHORS TODO ez_setup.py
+recursive-include werkzeug/debug/shared *
+recursive-include werkzeug/debug/templates *
 recursive-include tests *
+recursive-include docs *
+recursive-include examples *
+recursive-include artwork *

docs/build/api_stability.html

 <div class="section">
 <h3 id="backwards-incompatible-changes">Backwards Incompatible Changes</h3>
 <dl>
+<dt><cite>0.3</cite></dt>
+<dd><ul class="first last simple">
+<li>Werkzeug 0.3 will be the last release with Python 2.3 compatibility.</li>
+<li>The <cite>environ_property</cite> is now read-only by default.  This decision was
+made because the request in general should be considered read-only.</li>
+</ul>
+</dd>
 <dt><cite>0.2</cite></dt>
 <dd><ul class="first last simple">
 <li>The <cite>BaseReporterStream</cite> is now part of the contrib module, the
 the old name will disappear in Werkzeug 0.3.</li>
 <li><cite>match</cite> can now raise <cite>MethodNotAllowed</cite> if configured for
 methods and there was no method for that request.</li>
+<li>The <cite>response_body</cite> attribute on the response object is now called
+<cite>data</cite>.  With Werkzeug 0.3 the old name will not work any longer.</li>
+<li>The file-like methods on the response object are deprecated.  If
+you want to use the response object as file like object use the
+<cite>Response</cite> class or a subclass of <cite>BaseResponse</cite> and mix the new
+<cite>ResponseStreamMixin</cite> class and use <cite>response.stream</cite>.</li>
 </ul>
 </dd>
 </dl>

docs/build/exceptions.html

         <h4>Table of Contents</h4>
         <ul><li><a class="reference" href="#error-classes" id="id1" name="id1">Error Classes</a></li>
 <li><a class="reference" href="#baseclass" id="id2" name="id2">Baseclass</a></li>
-<li><a class="reference" href="#simple-aborting" id="id3" name="id3">Simple Aborting</a></li>
-<li><a class="reference" href="#custom-errors" id="id4" name="id4">Custom Errors</a></li>
+<li><a class="reference" href="#special-http-exceptions" id="id3" name="id3">Special HTTP Exceptions</a></li>
+<li><a class="reference" href="#simple-aborting" id="id4" name="id4">Simple Aborting</a></li>
+<li><a class="reference" href="#custom-errors" id="id5" name="id5">Custom Errors</a></li>
 </ul>
       </div>
       
 </dl>
 </div>
 <div class="section">
+<h3 id="special-http-exceptions">Special HTTP Exceptions</h3>
+<p>Starting with Werkzeug 0.3 some of the builtin classes raise exceptions that
+look like regular python exceptions (eg <cite>KeyError</cite>) but are <cite>BadRequest</cite>
+HTTP exceptions at the same time.  This decision was made to simplify a
+common pattern where you want to abort if the client tampered with the
+submitted form data in a way that the application can&#8217;t recover properly and
+should abort with <tt class="docutils literal"><span class="pre">400</span> <span class="pre">BAD</span> <span class="pre">REQUEST</span></tt>.</p>
+<p>Assuming the application catches all HTTP exceptions and reacts to them
+properly a view function could do the following savely and doesn&#8217;t have to
+check if the keys exist:</p>
+<div class="syntax"><pre><span class="k">def</span> <span class="nf">new_post</span><span class="p">(</span><span class="n">request</span><span class="p">):</span>
+    <span class="n">post</span> <span class="o">=</span> <span class="n">Post</span><span class="p">(</span><span class="n">title</span><span class="o">=</span><span class="n">request</span><span class="o">.</span><span class="n">form</span><span class="p">[</span><span class="s">&#39;title&#39;</span><span class="p">],</span> <span class="n">body</span><span class="o">=</span><span class="n">request</span><span class="o">.</span><span class="n">form</span><span class="p">[</span><span class="s">&#39;body&#39;</span><span class="p">])</span>
+    <span class="n">post</span><span class="o">.</span><span class="n">save</span><span class="p">()</span>
+    <span class="k">return</span> <span class="n">redirect</span><span class="p">(</span><span class="n">post</span><span class="o">.</span><span class="n">url</span><span class="p">)</span>
+</pre></div>
+<p>If <cite>title</cite> or <cite>body</cite> are missing in the form a <cite>MultiDict.KeyError</cite> will be
+raised which behaves like a <cite>KeyError</cite> but also a <cite>BadRequest</cite> exception.</p>
+</div>
+<div class="section">
 <h3 id="simple-aborting">Simple Aborting</h3>
 <p>Sometimes it&#8217;s convenient to just raise an exception by the error code,
 without importing the exception and looking up the name etc.  For this

docs/build/index.html

 <li><a class="reference" href="terms.html">Important Terms</a> &#8212; read this before reading the
 documentation</li>
 <li><a class="reference" href="tutorial.html">Tutorial</a> &#8212; getting started with Werkzeug</li>
+<li><a class="reference" href="unicode.html">Unicode</a> &#8212; short introduction into unicode in python
+and how Werkzeug encodes and decodes data.</li>
 <li><a class="reference" href="wrappers.html">Wrappers</a> &#8212; request and response objects</li>
 <li><a class="reference" href="routing.html">Routing System</a> &#8212; a powerful URL dispatcher
 and builder</li>

docs/build/installation.html

 <h4 id="if-you-just-want-the-latest-features-and-use-them">If you just want the latest features and use them</h4>
 <div class="syntax"><pre><span class="n">sudo</span> <span class="n">easy_install</span> <span class="n">Werkzeug</span><span class="o">==</span><span class="n">dev</span>
 </pre></div>
-<p>This will install a Werkzeug egg containing the latest Subversion trunk code
-in your Python installation&#8217;s <cite>site-packages</cite> directory. Every time the
-command is run, the sources are updated from Subversion the Subversion
-repository.</p>
+<p>This will install a Werkzeug egg containing the latest mercurial tip in
+your Python installation&#8217;s <cite>site-packages</cite> directory. Every time the
+command is run, the sources are updated from the mercurial repository.</p>
 </div>
 </div>
 <div class="section">

docs/build/local.html

 <h3 id="objects">Objects</h3>
 <dl>
 <dt><strong>class</strong> <cite id="werkzeug.local.LocalManager">LocalManager</cite></dt>
-<dd><p class="first">Local objects cannot manage themselves. For that you need a local manager.
-You can pass a local manager multiple locals or add them later by
-appending them to <cite>manager.locals</cite>.  Everytime the manager cleans up it,
-will clean up all the data left in the locals for this context.</p>
+<dd><p class="first">Local objects cannot manage themselves. For that you need a local
+manager.  You can pass a local manager multiple locals or add them later
+by appending them to <cite>manager.locals</cite>.  Everytime the manager cleans up
+it, will clean up all the data left in the locals for this context.</p>
 <dl>
 <dt><cite id="werkzeug.local.LocalManager.cleanup">cleanup</cite> <tt class="func-signature docutils literal"><span class="pre">()</span></tt></dt>
-<dd>Manually clean up the data in the locals for this context.  Call this
-at the end of the request or use <cite>make_middleware()</cite>.</dd>
+<dd>Manually clean up the data in the locals for this context.  Call
+this at the end of the request or use <cite>make_middleware()</cite>.</dd>
 </dl>
 <dl>
 <dt><cite id="werkzeug.local.LocalManager.make_middleware">make_middleware</cite> <tt class="func-signature docutils literal"><span class="pre">(app)</span></tt></dt>
 </dl>
 <dl>
 <dt><cite id="werkzeug.local.LocalManager.middleware">middleware</cite> <tt class="func-signature docutils literal"><span class="pre">(func)</span></tt></dt>
-<dd><p class="first">Like <cite>make_middleware</cite> but for decorating functions.  Example
-usage:</p>
+<dd><p class="first">Like <cite>make_middleware</cite> but for decorating functions.</p>
+<p>Example usage:</p>
 <div class="syntax"><pre><span class="nd">@manager</span><span class="o">.</span><span class="n">middleware</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="o">...</span>
 <p>Whenever something is bound to l.user / l.request the proxy objects
 will forward all operations.  If no object is bound a <cite>RuntimeError</cite>
 will be raised.</p>
+<dl>
+<dt><cite id="werkzeug.local.LocalProxy._get_current_object">_get_current_object</cite> <tt class="func-signature docutils literal"><span class="pre">()</span></tt></dt>
+<dd>Return the current object.  This is useful if you want the real
+object behind the proxy at a time for performance reasons or because
+you want to pass the object into a different context.</dd>
+</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>

docs/build/organizing.html

 <span class="k">from</span> <span class="nn">mypackage.urls</span> <span class="k">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="nb">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>
+    <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>
     <span class="n">req</span> <span class="o">=</span> <span class="n">Request</span><span class="p">(</span><span class="n">environ</span><span class="p">)</span>
     <span class="k">try</span><span class="p">:</span>
         <span class="n">endpoint</span><span class="p">,</span> <span class="n">values</span> <span class="o">=</span> <span class="n">url_adapter</span><span class="o">.</span><span class="n">match</span><span class="p">()</span>
         <span class="n">view</span> <span class="o">=</span> <span class="n">import_string</span><span class="p">(</span><span class="s">&#39;mypackage.views.&#39;</span> <span class="o">+</span> <span class="n">endpoint</span><span class="p">)</span>
-        <span class="n">resp</span> <span class="o">=</span> <span class="n">view</span><span class="p">(</span><span class="n">req</span><span class="p">,</span> <span class="o">**</span><span class="n">args</span><span class="p">)</span>
+        <span class="n">resp</span> <span class="o">=</span> <span class="n">view</span><span class="p">(</span><span class="n">req</span><span class="p">,</span> <span class="o">**</span><span class="n">values</span><span class="p">)</span>
     <span class="k">except</span> <span class="p">(</span><span class="n">RequestRedirect</span><span class="p">,</span> <span class="n">HTTPException</span><span class="p">),</span> <span class="n">e</span><span class="p">:</span>
         <span class="n">resp</span> <span class="o">=</span> <span class="n">e</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>

docs/build/routing.html

 </ul>
 </dd>
 <dt><cite>path</cite></dt>
-<dd><p class="first">Matches one of the items provided.  Items can either be python
-identifiers or unicode strings:</p>
-<div class="syntax"><pre><span class="n">Rule</span><span class="p">(</span><span class="s">&#39;/&lt;any(about, help, imprint, u&quot;class&quot;):page_name&gt;&#39;</span><span class="p">)</span>
-</pre></div>
-</dd>
+<dd>Like the default string converter, but it also matches slashes.</dd>
 <dt><cite>any</cite></dt>
 <dd><p class="first">Matches one of the items provided.  Items can either be Python
 identifiers or unicode strings:</p>
 </dl>
 <dl class="last">
 <dt><cite id="werkzeug.routing.Map.bind_to_environ">bind_to_environ</cite> <tt class="func-signature docutils literal"><span class="pre">(environ,</span> <span class="pre">server_name=None,</span> <span class="pre">subdomain=None,</span> <span class="pre">calculate_subdomain=False)</span></tt></dt>
-<dd><p class="first">Like <cite>bind</cite> but you can pass it an WSGI environment and it will fetch
-the information from that directory.  Note that because of limitations
-in the protocol there is no way to get the current subdomain and real
-<cite>server_name</cite> from the environment.  If you don&#8217;t provide it, Werkzeug
-will use <cite>SERVER_NAME</cite> and <cite>SERVER_PORT</cite> (or <cite>HTTP_HOST</cite> if provided)
-as used <cite>server_name</cite> with disabled subdomain feature.</p>
+<dd><p class="first">Like <cite>bind</cite> but you can pass it an WSGI environment and it will
+fetch the information from that directory.  Note that because of
+limitations in the protocol there is no way to get the current
+subdomain and real <cite>server_name</cite> from the environment.  If you don&#8217;t
+provide it, Werkzeug will use <cite>SERVER_NAME</cite> and <cite>SERVER_PORT</cite> (or
+<cite>HTTP_HOST</cite> if provided) as used <cite>server_name</cite> with disabled subdomain
+feature.</p>
 <p>If <cite>subdomain</cite> is <cite>None</cite> but an environment and a server name is
 provided it will calculate the current subdomain automatically.
 Example: <cite>server_name</cite> is <tt class="docutils literal"><span class="pre">'example.com'</span></tt> and the <cite>SERVER_NAME</cite>
 URL matching and building based on runtime information.</p>
 <dl>
 <dt><cite id="werkzeug.routing.MapAdapter.match">match</cite> <tt class="func-signature docutils literal"><span class="pre">(path_info=None,</span> <span class="pre">method=None)</span></tt></dt>
-<dd><p class="first">The usage is simple: you just pass the match method the current path
-info as well as the method (which defaults to <cite>GET</cite>).  The following
-things can then happen:</p>
+<dd><p class="first">The usage is simple: you just pass the match method the current
+path info as well as the method (which defaults to <cite>GET</cite>).  The
+following things can then happen:</p>
 <ul class="simple">
 <li>you receive a <cite>NotFound</cite> exception that indicates that no URL is
 matching.  A <cite>NotFound</cite> exception is also a WSGI application you
 <p>And here is what happens on redirect and missing URLs:</p>
 <div class="syntax"><pre><span class="gp">&gt;&gt;&gt; </span><span class="n">urls</span><span class="o">.</span><span class="n">match</span><span class="p">(</span><span class="s">&quot;/downloads&quot;</span><span class="p">)</span>
 <span class="gt">Traceback (most recent call last):</span>
-<span class="c">...</span>
+  <span class="c">...</span>
 <span class="nc">werkzeug.routing.RequestRedirect</span>: <span class="n-Identifier">http://example.com/downloads/</span>
 <span class="gp">&gt;&gt;&gt; </span><span class="n">urls</span><span class="o">.</span><span class="n">match</span><span class="p">(</span><span class="s">&quot;/missing&quot;</span><span class="p">)</span>
 <span class="gt">Traceback (most recent call last):</span>
-<span class="c">...</span>
+  <span class="c">...</span>
 <span class="nc">werkzeug.routing.NotFound</span>: <span class="n-Identifier">/missing</span>
 </pre></div>
 </dd>
 </dl>
 <dl>
 <dt><cite id="werkzeug.routing.MapAdapter.test">test</cite> <tt class="func-signature docutils literal"><span class="pre">(path_info=None,</span> <span class="pre">method=None)</span></tt></dt>
-<dd>Test if a rule would match.  Works like <cite>match</cite> but returns <cite>True</cite> if
-the URL matches, or <cite>False</cite> if it does not exist.</dd>
+<dd>Test if a rule would match.  Works like <cite>match</cite> but returns <cite>True</cite>
+if the URL matches, or <cite>False</cite> if it does not exist.</dd>
 </dl>
 <dl>
 <dt><cite id="werkzeug.routing.MapAdapter.dispatch">dispatch</cite> <tt class="func-signature docutils literal"><span class="pre">(view_func,</span> <span class="pre">path_info=None,</span> <span class="pre">method=None,</span> <span class="pre">catch_http_exceptions=False)</span></tt></dt>
     <span class="k">return</span> <span class="n">urls</span><span class="o">.</span><span class="n">dispatch</span><span class="p">(</span><span class="k">lambda</span> <span class="n">e</span><span class="p">,</span> <span class="n">v</span><span class="p">:</span> <span class="n">views</span><span class="p">[</span><span class="n">e</span><span class="p">](</span><span class="n">request</span><span class="p">,</span> <span class="o">**</span><span class="n">v</span><span class="p">),</span>
                          <span class="n">catch_http_exceptions</span><span class="o">=</span><span class="bp">True</span><span class="p">)</span>
 </pre></div>
+<p class="last">Keep in mind that this method might return exception objects too, so
+use <cite>Response.force_type</cite> to get a response object.</p>
 </dd>
 </dl>
 <dl class="last">
 </dl>
 <dl>
 <dt><strong>class</strong> <cite id="werkzeug.routing.Rule">Rule</cite></dt>
-<dd><p class="first">A Rule represents one URL pattern.  There are some options for <cite>Rule</cite> that
-change the way it behaves and are passed to the <cite>Rule</cite> constructor.  Note
-that beside the rule-string all arguments <em>must</em> be keyword arguments in
-order to not break the application on Werkzeug upgrades.</p>
+<dd><p class="first">A Rule represents one URL pattern.  There are some options for <cite>Rule</cite>
+that change the way it behaves and are passed to the <cite>Rule</cite> constructor.
+Note that beside the rule-string all arguments <em>must</em> be keyword arguments
+in order to not break the application on Werkzeug upgrades.</p>
 <dl>
 <dt><cite>string</cite></dt>
 <dd><p class="first">Rule strings basically are just normal URL paths with placeholders in
 <dt><cite>endpoint</cite></dt>
 <dd>The endpoint for this rule. This can be anything. A reference to a
 function, a string, a number etc.  The preferred way is using a string
-because the endpoint is used for URL generation.</dd>
+as because the endpoint is used for URL generation.</dd>
 <dt><cite>defaults</cite></dt>
 <dd><p class="first">An optional dict with defaults for other rules with the same endpoint.
 This is a bit tricky but useful if you want to have unique URLs:</p>
 <dd>Set this to true and the rule will never match but will create a URL
 that can be build. This is useful if you have resources on a subdomain
 or folder that are not handled by the WSGI application (like static data)</dd>
+<dt><cite>redirect_to</cite></dt>
+<dd><p class="first">If given this must be either a string or callable.  In case of a
+callable it&#8217;s called with the url adapter that triggered the match and
+the values of the URL as keyword arguments and has to return the target
+for the redirect, otherwise it has to be a string with placeholders in
+rule syntax:</p>
+<div class="syntax"><pre><span class="k">def</span> <span class="nf">foo_with_slug</span><span class="p">(</span><span class="n">adapter</span><span class="p">,</span> <span class="nb">id</span><span class="p">):</span>
+    <span class="c"># ask the database for the slug for the old id.  this of</span>
+    <span class="c"># course has nothing to do with werkzeug.</span>
+    <span class="k">return</span> <span class="s">&#39;foo/&#39;</span> <span class="o">+</span> <span class="n">Foo</span><span class="o">.</span><span class="n">get_slug_for_id</span><span class="p">(</span><span class="nb">id</span><span class="p">)</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;/foo/&lt;slug&gt;&#39;</span><span class="p">,</span> <span class="n">endpoint</span><span class="o">=</span><span class="s">&#39;foo&#39;</span><span class="p">),</span>
+    <span class="n">Rule</span><span class="p">(</span><span class="s">&#39;/some/old/url/&lt;slug&gt;&#39;</span><span class="p">,</span> <span class="n">redirect_to</span><span class="o">=</span><span class="s">&#39;foo/&lt;slug&gt;&#39;</span><span class="p">),</span>
+    <span class="n">Rule</span><span class="p">(</span><span class="s">&#39;/other/old/url/&lt;int:id&gt;&#39;</span><span class="p">,</span> <span class="n">redirect_to</span><span class="o">=</span><span class="n">foo_with_slug</span><span class="p">)</span>
+<span class="p">])</span>
+</pre></div>
+<p>When the rule is matched the routing system will raise a
+<cite>RequestRedirect</cite> exception with the target for the redirect.</p>
+<p class="last">Keep in mind that the URL will be joined against the URL root of the
+script so don&#8217;t use a leading slash on the target URL unless you
+really mean root of that domain.</p>
+</dd>
 </dl>
 <dl>
 <dt><cite id="werkzeug.routing.Rule.empty">empty</cite> <tt class="func-signature docutils literal"><span class="pre">()</span></tt></dt>
-<dd>Return an unbound copy of this rule.  This can be useful if you want
-to reuse an already bound URL for another map.</dd>
+<dd>Return an unbound copy of this rule.  This can be useful if you
+want to reuse an already bound URL for another map.</dd>
 </dl>
 <dl class="last">
 <dt><cite id="werkzeug.routing.Rule.bind">bind</cite> <tt class="func-signature docutils literal"><span class="pre">(map)</span></tt></dt>
     </div>
   </div>
 </body>
-</html>
+</html>

docs/build/serving.html

 <p>You can also pass it the <cite>extra_files</cite> keyword argument with a list of
 additional files (like configuration files) you want to observe.</p>
 <dl>
-<dt><cite id="werkzeug.serving.run_simple">run_simple</cite> <tt class="func-signature docutils literal"><span class="pre">(hostname,</span> <span class="pre">port,</span> <span class="pre">application,</span> <span class="pre">use_reloader=False,</span> <span class="pre">extra_files=None,</span> <span class="pre">reloader_interval=1,</span> <span class="pre">threaded=False,</span> <span class="pre">processes=1,</span> <span class="pre">request_handler=None)</span></tt></dt>
+<dt><cite id="werkzeug.serving.run_simple">run_simple</cite> <tt class="func-signature docutils literal"><span class="pre">(hostname,</span> <span class="pre">port,</span> <span class="pre">application,</span> <span class="pre">use_reloader=False,</span> <span class="pre">use_debugger=False,</span> <span class="pre">use_evalex=True,</span> <span class="pre">extra_files=None,</span> <span class="pre">reloader_interval=1,</span> <span class="pre">threaded=False,</span> <span class="pre">processes=1,</span> <span class="pre">request_handler=None)</span></tt></dt>
 <dd><p class="first">Start an application using wsgiref and with an optional reloader.  This
 wraps <cite>wsgiref</cite> to fix the wrong default reporting of the multithreaded
 WSGI variable and adds optional multithreading and fork support.</p>
 <p><strong>application</strong>: the WSGI application to execute</p>
 <p><strong>use_reloader</strong>: should the server automatically restart the python
 process if modules were changed?</p>
+<p><strong>use_debugger</strong>: should the werkzeug debugging system be used?</p>
+<p><strong>use_evalex</strong>: should the exception evaluation feature be enabled?</p>
 <p><strong>extra_files</strong>: a list of files the reloader should listen for
 additionally to the modules.  For example configuration
 files.</p>

docs/build/templates.html

         <h4>Table of Contents</h4>
         <ul><li><a class="reference" href="#syntax-elements" id="id1" name="id1">Syntax Elements</a></li>
 <li><a class="reference" href="#missing-variables" id="id2" name="id2">Missing Variables</a></li>
-<li><a class="reference" href="#the-template-class" id="id3" name="id3">The Template Class</a></li>
+<li><a class="reference" href="#python-2-3-compatibility" id="id3" name="id3">Python 2.3 Compatibility</a></li>
+<li><a class="reference" href="#the-template-class" id="id4" name="id4">The Template Class</a></li>
 </ul>
       </div>
       
 from the <cite>werkzeug</cite> module.</p>
 <p>This template engine recognizes ASP/PHP like blocks and executes the code
 in them:</p>
-<div class="syntax"><pre><span class="n">t</span> <span class="o">=</span> <span class="n">Template</span><span class="p">(</span><span class="s">&#39;&lt;</span><span class="si">% f</span><span class="s">or u in users %&gt;${u[&#39;</span><span class="n">username</span><span class="s">&#39;]}</span><span class="se">\n</span><span class="s">&lt;</span><span class="si">% e</span><span class="s">ndfor %&gt;&#39;</span><span class="p">)</span>
+<div class="syntax"><pre><span class="n">t</span> <span class="o">=</span> <span class="n">Template</span><span class="p">(</span><span class="s">&#39;&lt;</span><span class="si">% f</span><span class="s">or u in users %&gt;${u[&quot;username&quot;]}</span><span class="se">\n</span><span class="s">&lt;</span><span class="si">% e</span><span class="s">ndfor %&gt;&#39;</span><span class="p">)</span>
 <span class="n">t</span><span class="o">.</span><span class="n">render</span><span class="p">(</span><span class="n">users</span><span class="o">=</span><span class="p">[{</span><span class="s">&#39;username&#39;</span><span class="p">:</span> <span class="s">&#39;John&#39;</span><span class="p">},</span>
                 <span class="p">{</span><span class="s">&#39;username&#39;</span><span class="p">:</span> <span class="s">&#39;Jane&#39;</span><span class="p">}])</span>
 </pre></div>
 </pre></div>
 </div>
 <div class="section">
+<h3 id="python-2-3-compatibility">Python 2.3 Compatibility</h3>
+<p>Because of limitations in Python 2.3 it&#8217;s impossible to achieve the
+semi-silent variable lookup fallback.  If a template relies on undefined
+variables it won&#8217;t execute under Python 2.3.</p>
+</div>
+<div class="section">
 <h3 id="the-template-class">The Template Class</h3>
 <dl>
 <dt><strong>class</strong> <cite id="werkzeug.templates.Template">Template</cite></dt>

docs/build/test.html

 </dl>
 <dl>
 <dt><cite id="werkzeug.test.Client.open">open</cite> <tt class="func-signature docutils literal"><span class="pre">(path='/',</span> <span class="pre">base_url=None,</span> <span class="pre">query_string=None,</span> <span class="pre">method='GET',</span> <span class="pre">data=None,</span> <span class="pre">input_stream=None,</span> <span class="pre">content_type=None,</span> <span class="pre">content_length=0,</span> <span class="pre">errors_stream=None,</span> <span class="pre">multithread=False,</span> <span class="pre">multiprocess=False,</span> <span class="pre">run_once=False,</span> <span class="pre">environ_overrides=None,</span> <span class="pre">as_tuple=False)</span></tt></dt>
-<dd><p class="first">Takes the same arguments as the <cite>create_environ</cite> function from the utility
-module with some additions.</p>
+<dd><p class="first">Takes the same arguments as the <cite>create_environ</cite> function from the
+utility module with some additions.</p>
 <p>The first parameter should be the path of the request which defaults to
 &#8216;/&#8217;.  The second one can either be a absolute path (in that case the url
 host is localhost:80) or a full path to the request with scheme,

docs/build/tutorial.html

 past.  One of them is using view functions instead of controller classes with
 action methods, which is common in <a class="reference" href="http://www.rubyonrails.org/">Rails</a> and <a class="reference" href="http://pylonshq.com/">Pylons</a>, the other one is
 designer-friendly templates.</p>
-<p>The Werkzeug <a class="reference" href="http://dev.pocoo.org/projects/werkzeug/browser/example">example folder</a> contains a couple of applications that use other
+<p>The Werkzeug <a class="reference" href="http://dev.pocoo.org/projects/werkzeug/browser/examples">example folder</a> contains a couple of applications that use other
 template engines, too, so you may want to have a look at them.  There is also
 the source code of this application.</p>
 <p>You can use <a class="reference" href="http://peak.telecommunity.com/DevCenter/EasyInstall">easy_install</a> to install the required libraries:</p>
 <cite>session</cite> object pulled from there is not a PHP-like session object but a
 SQLAlchemy database session object.  Basically a database session object keeps
 track of yet uncommited objects for the database.  Unlike Django, an
-instanciated SQLAlchemy model is already tracked by the session!  The metadata
+instantiated SQLAlchemy model is already tracked by the session!  The metadata
 object is also an SQLAlchemy thing which is used to keep track of tables.  We
 can use the metadata object to easily create all tables for the database and
 SQLAlchemy uses it to look up foreign keys and similar stuff.</p>
 <p>After that we have a <cite>try</cite>/<cite>except</cite> that catches HTTP exceptions that could
 occur while matching or in the view function.  When the adapter does not find
 a valid endpoint for our current request it will raise a <cite>NotFound</cite> exception
-which we can use like a response object.  And endpoint is basically the name
+which we can use like a response object.  An endpoint is basically the name
 of the function we want to handle our request with.  We just get the
 function with the name of the endpoint and pass it the request and the URL
 values.</p>
 <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">for</span> <span class="n">os</span> <span class="k">import</span> <span class="nn">path</span>
+<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>
 have to explicitly tell the webserver or our development server that some
 path holds static files.</p>
 <p>Django even recommends a separate subdomain and standalone server for the
-static files which is a terrible good idea for heavy load environments but
-somewhat of an overkill for that simple application.</p>
+static files which is a terribly good idea for heavily loaded environments but
+somewhat of an overkill for this simple application.</p>
 <p>So here is the deal: We let our application host the static files, but in
 production mode you should probably tell the apache to serve those files by
 using an <cite>Alias</cite> directive in the apache config:</p>
 </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</span> <span class="k">import</span> <span class="n">NotFound</span>
+<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>
 </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>

docs/build/tutorial_de.html

 <a class="reference" href="http://www.djangoproject.com/">Django</a>-ähnlichen Grundaufbau nachstellen wollen.  Dazu zählen wir zum
 Beispiel View-Funktionen anstelle der in <a class="reference" href="http://www.rubyonrails.org/">Rails</a> und <a class="reference" href="http://pylonshq.com/">Pylons</a> gängigen
 Controller-Klassen mit Action-Methoden, sowie designerfreundliche Templates.</p>
-<p>In Werkzeugs <a class="reference" href="http://dev.pocoo.org/projects/werkzeug/browser/example">Beispiel-Ordner</a> befinden sich einige Anwendungen, die andere
+<p>In Werkzeugs <a class="reference" href="http://dev.pocoo.org/projects/werkzeug/browser/examples">Beispiel-Ordner</a> befinden sich einige Anwendungen, die andere
 Konzepte verfolgen, Template-Engines einsetzen etc.  Dort liegt auch der
 Quellcode der Anwendung, die wir in diesem Tutorial erstellen werden.</p>
 <p>Du kannst <a class="reference" href="http://peak.telecommunity.com/DevCenter/EasyInstall">easy_install</a> verwenden, um Jinja und SQLAlchemy zu installieren,
         <span class="k">if</span> <span class="ow">not</span> <span class="n">validate_url</span><span class="p">(</span><span class="n">url</span><span class="p">):</span>
             <span class="n">error</span> <span class="o">=</span> <span class="s">u&quot;Entschuldigung, aber ich kann die angegebene &quot;</span> \
                     <span class="s">u&quot;URL nicht kürzen.&quot;</span>
-    <span class="k">elif</span> <span class="n">alias</span><span class="p">:</span>
+        <span class="k">elif</span> <span class="n">alias</span><span class="p">:</span>
             <span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">alias</span><span class="p">)</span> <span class="o">&gt;</span> <span class="mf">140</span><span class="p">:</span>
                 <span class="n">error</span> <span class="o">=</span> <span class="s">&#39;Dein Alias ist zu lang&#39;</span>
             <span class="k">elif</span> <span class="s">&#39;/&#39;</span> <span class="ow">in</span> <span class="n">alias</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">for</span> <span class="n">os</span> <span class="k">import</span> <span class="nn">path</span>
+<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>
 </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</span> <span class="k">import</span> <span class="n">NotFound</span>
+<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>
 </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>

docs/build/utils.html

 </pre></div>
 <p>It behaves like a normal dict thus all dict functions will only return the
 first value when multiple values for one key are found.</p>
+<p>From Werkzeug 0.3 onwards, the <cite>KeyError</cite> raised by this class is also a
+subclass of the <cite>BadRequest</cite> HTTP exception and will render a page for a
+<tt class="docutils literal"><span class="pre">400</span> <span class="pre">BAD</span> <span class="pre">REQUEST</span></tt> if catched in a catch-all for HTTP exceptions.</p>
 <p>The following additional methods exist that are used to get or set the
 other values for a key or convert:</p>
 <dl>
 <span class="gp">&gt;&gt;&gt; </span><span class="n">combined</span><span class="p">[</span><span class="s">&#39;blub&#39;</span><span class="p">]</span>
 <span class="go">&#39;blah&#39;</span>
 </pre></div>
-<p class="last">This works for all read operations and will raise a <cite>TypeError</cite> for
+<p>This works for all read operations and will raise a <cite>TypeError</cite> for
 methods that usually change data which isn&#8217;t possible.</p>
+<p class="last">From Werkzeug 0.3 onwards, the <cite>KeyError</cite> raised by this class is also a
+subclass of the <cite>BadRequest</cite> HTTP exception and will render a page for a
+<tt class="docutils literal"><span class="pre">400</span> <span class="pre">BAD</span> <span class="pre">REQUEST</span></tt> if catched in a catch-all for HTTP exceptions.</p>
 </dd>
 </dl>
 <dl>
 but is ordered and can store keys multiple times.</p>
 <p>This data structure is useful if you want a nicer way to handle WSGI
 headers which are stored as tuples in a list.</p>
+<p>From Werkzeug 0.3 onwards, the <cite>KeyError</cite> raised by this class is also a
+subclass of the <cite>BadRequest</cite> HTTP exception and will render a page for a
+<tt class="docutils literal"><span class="pre">400</span> <span class="pre">BAD</span> <span class="pre">REQUEST</span></tt> if catched in a catch-all for HTTP exceptions.</p>
 <dl>
 <dt><cite id="werkzeug.utils.Headers.__init__">__init__</cite> <tt class="func-signature docutils literal"><span class="pre">(defaults=None,</span> <span class="pre">_list=None)</span></tt></dt>
-<dd>Create a new <cite>Headers</cite> object based on a list or dict of headers which
-are used as default values.  This does not reuse the list passed to
-the constructor for internal usage.  To create a <cite>Headers</cite> object that
-uses as internal storage the list or list-like object provided it&#8217;s
-possible to use the <cite>linked</cite> classmethod.</dd>
+<dd>Create a new <cite>Headers</cite> object based on a list or dict of headers
+which are used as default values.  This does not reuse the list passed
+to the constructor for internal usage.  To create a <cite>Headers</cite> object
+that uses as internal storage the list or list-like object provided
+it&#8217;s possible to use the <cite>linked</cite> classmethod.</dd>
 </dl>
 <dl>
 <dt><cite id="werkzeug.utils.Headers.linked">linked</cite> <tt class="func-signature docutils literal"><span class="pre">(headerlist)</span></tt></dt>
-<dd><p class="first">Create a new <cite>Headers</cite> object that uses the list of headers passed as
-internal storage:</p>
+<dd><p class="first">Create a new <cite>Headers</cite> object that uses the list of headers passed
+as internal storage:</p>
 <div class="syntax"><pre><span class="gp">&gt;&gt;&gt; </span><span class="n">headerlist</span> <span class="o">=</span> <span class="p">[(</span><span class="s">&#39;Content-Length&#39;</span><span class="p">,</span> <span class="s">&#39;40&#39;</span><span class="p">)]</span>
 <span class="gp">&gt;&gt;&gt; </span><span class="n">headers</span> <span class="o">=</span> <span class="n">Headers</span><span class="o">.</span><span class="n">linked</span><span class="p">(</span><span class="n">headerlist</span><span class="p">)</span>
 <span class="gp">&gt;&gt;&gt; </span><span class="n">headers</span><span class="o">.</span><span class="n">add</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>
 </dl>
 <dl>
 <dt><cite id="werkzeug.utils.Headers.to_list">to_list</cite> <tt class="func-signature docutils literal"><span class="pre">(charset='utf-8')</span></tt></dt>
-<dd><p class="first">Convert the headers into a list and converts the unicode header items
-to the specified charset.</p>
+<dd><p class="first">Convert the headers into a list and converts the unicode header
+items to the specified charset.</p>
 <p class="last"><strong>returns</strong>: list</p>
 </dd>
 </dl>
 </dl>
 <dl>
 <dt><strong>class</strong> <cite id="werkzeug.utils.EnvironHeaders">EnvironHeaders</cite></dt>
-<dd>Read only version of the headers from a WSGI environment.  This
+<dd><p class="first">Read only version of the headers from a WSGI environment.  This
 provides the same interface as <cite>Headers</cite> and is constructed from
-a WSGI environment.</dd>
+a WSGI environment.</p>
+<p class="last">From Werkzeug 0.3 onwards, the <cite>KeyError</cite> raised by this class is also a
+subclass of the <cite>BadRequest</cite> HTTP exception and will render a page for a
+<tt class="docutils literal"><span class="pre">400</span> <span class="pre">BAD</span> <span class="pre">REQUEST</span></tt> if catched in a catch-all for HTTP exceptions.</p>
+</dd>
 </dl>
 </div>
 <div class="section">
 be <cite>None</cite>.</dd>
 </dl>
 <dl>
-<dt><cite id="werkzeug.http.dump_header">dump_header</cite> <tt class="func-signature docutils literal"><span class="pre">(iterable)</span></tt></dt>
-<dd>Dump an HTTP header again.  This is the reversal of <cite>parse_list_header</cite>,
-<cite>parse_set_header</cite> and <cite>parse_dict_header</cite>.  This also quotes strings
-that include an equals sign unless you pass it as dict of key, value
-pairs.</dd>
+<dt><cite id="werkzeug.http.dump_header">dump_header</cite> <tt class="func-signature docutils literal"><span class="pre">(iterable,</span> <span class="pre">allow_token=True)</span></tt></dt>
+<dd><p class="first">Dump an HTTP header again.  This is the reversal of
+<cite>parse_list_header</cite>, <cite>parse_set_header</cite> and <cite>parse_dict_header</cite>.  This
+also quotes strings that include an equals sign unless you pass it as dict
+of key, value pairs.</p>
+<p class="last">The <cite>allow_token</cite> parameter can be set to <cite>False</cite> to disallow tokens as
+values.  If this is enabled all values are quoted.</p>
+</dd>
 </dl>
 <dl>
 <dt><strong>class</strong> <cite id="werkzeug.http.Accept">Accept</cite></dt>
 </dl>
 <dl>
 <dt><cite id="werkzeug.http.Accept.__getitem__">__getitem__</cite> <tt class="func-signature docutils literal"><span class="pre">(key)</span></tt></dt>
-<dd>Beside index lookup (getting item n) you can also pass it a string to
-get the quality for the item.  If the item is not in the list, the
+<dd>Beside index lookup (getting item n) you can also pass it a string
+to get the quality for the item.  If the item is not in the list, the
 returned quality is <tt class="docutils literal"><span class="pre">0</span></tt>.</dd>
 </dl>
 <dl>
 </dl>
 <dl>
 <dt><cite id="werkzeug.http.parse_accept_header">parse_accept_header</cite> <tt class="func-signature docutils literal"><span class="pre">(value)</span></tt></dt>
-<dd><p class="first">Parses an HTTP Accept-* header.  This does not implement a complete valid
-algorithm but one that supports at least value and quality extraction.</p>
+<dd><p class="first">Parses an HTTP Accept-* header.  This does not implement a complete
+valid algorithm but one that supports at least value and quality
+extraction.</p>
 <p class="last">Returns a new <cite>Accept</cite> object (basicly a list of <tt class="docutils literal"><span class="pre">(value,</span> <span class="pre">quality)</span></tt>
-tuples sorted by the quality with some additional accessor methods)</p>
+tuples sorted by the quality with some additional accessor methods).</p>
 </dd>
 </dl>
 <dl>
 <dt><strong>class</strong> <cite id="werkzeug.http.CacheControl">CacheControl</cite></dt>
-<dd><p class="first">Subclass of a dict that stores values for a Cache-Control header.  It has
-accesors for all the cache-control directives specified in RFC 2616.  The
-class does not differentiate between request and response directives.</p>
+<dd><p class="first">Subclass of a dict that stores values for a Cache-Control header.  It
+has accesors for all the cache-control directives specified in RFC 2616.
+The class does not differentiate between request and response directives.</p>
 <p>Because the cache-control directives in the HTTP header use dashes the
 python descriptors use underscores for that.</p>
 <p>To get a header of the <cite>CacheControl</cite> object again you can convert the
 </dl>
 <dl>
 <dt><cite id="werkzeug.http.HeaderSet.as_set">as_set</cite> <tt class="func-signature docutils literal"><span class="pre">(preserve_casing=False)</span></tt></dt>
-<dd><p class="first">Return the set as real python set structure.  When calling this all
-the items are converted to lowercase and the ordering is lost.</p>
+<dd><p class="first">Return the set as real python set structure.  When calling this
+all the items are converted to lowercase and the ordering is lost.</p>
 <p class="last">If <cite>preserve_casing</cite> is <cite>True</cite> the items in the set returned will
 have the original case like in the <cite>HeaderSet</cite>, otherwise they will
 be lowercase.</p>
 </dd>
 </dl>
 <dl>
-<dt><cite id="werkzeug.http.parse_set_header">parse_set_header</cite> <tt class="func-signature docutils literal"><span class="pre">(value,</span> <span class="pre">on_update=None)</span></tt></dt>
-<dd>Parse a set like header and return a <cite>HeaderSet</cite> object.  The return
-value is an object that treats the items case insensitive and keeps the
-order of the items.</dd>
-</dl>
-<dl>
 <dt><strong>class</strong> <cite id="werkzeug.useragents.UserAgent">UserAgent</cite></dt>
 <dd><p class="first">Represents a user agent.  Pass it a WSGI environment or an user agent
 string and you can inspect some of the details from the user agent
 </dd>
 </dl>
 <dl>
+<dt><cite id="werkzeug.utils.cookie_date">cookie_date</cite> <tt class="func-signature docutils literal"><span class="pre">(expires=None)</span></tt></dt>
+<dd><p class="first">Formats the time to ensure compatibility with Netscape&#8217;s cookie
+standard.</p>
+<p>Accepts a floating point number expressed in seconds since the epoc in, a
+datetime object or a timetuple.  All times in UTC.  The <cite>parse_date</cite>
+function in <cite>werkzeug.http</cite> can be used to parse such a date.</p>
+<p class="last">Outputs a string in the format <tt class="docutils literal"><span class="pre">Wdy,</span> <span class="pre">DD-Mon-YYYY</span> <span class="pre">HH:MM:SS</span> <span class="pre">GMT</span></tt>.</p>
+</dd>
+</dl>
+<dl>
+<dt><cite id="werkzeug.utils.http_date">http_date</cite> <tt class="func-signature docutils literal"><span class="pre">(timestamp=None)</span></tt></dt>
+<dd><p class="first">Formats the time to match the RFC1123 date format.</p>
+<p>Accepts a floating point number expressed in seconds since the epoc in, a
+datetime object or a timetuple.  All times in UTC.  The <cite>parse_date</cite>
+function in <cite>werkzeug.http</cite> can be used to parse such a date.</p>
+<p class="last">Outputs a string in the format <tt class="docutils literal"><span class="pre">Wdy,</span> <span class="pre">DD</span> <span class="pre">Mon</span> <span class="pre">YYYY</span> <span class="pre">HH:MM:SS</span> <span class="pre">GMT</span></tt>.</p>
+</dd>
+</dl>
+<dl>
+<dt><cite id="werkzeug.utils.parse_form_data">parse_form_data</cite> <tt class="func-signature docutils literal"><span class="pre">(environ,</span> <span class="pre">stream_factory=None,</span> <span class="pre">charset='utf-8',</span> <span class="pre">errors='ignore')</span></tt></dt>
+<dd><p class="first">Parse the form data in the environ and return it as tuple in the form
+<tt class="docutils literal"><span class="pre">(stream,</span> <span class="pre">form,</span> <span class="pre">files)</span></tt>.  You should only call this method if the
+transport method is <cite>POST</cite> or <cite>PUT</cite>.</p>
+<p class="last">If the mimetype of the data transmitted is <cite>multipart/form-data</cite> the
+files multidict will be filled with <cite>FileStorage</cite> objects.  If the
+mimetype is unknow the input stream is wrapped and returned as first
+argument, else the stream is empty.</p>
+</dd>
+</dl>
+<dl>
 <dt><strong>class</strong> <cite id="werkzeug.http.ETags">ETags</cite></dt>
 <dd><p class="first">A set that can be used to check if one etag is present in a collection
 of etags.</p>
 </dl>
 <dl>
 <dt><cite id="werkzeug.http.ETags.contains_raw">contains_raw</cite> <tt class="func-signature docutils literal"><span class="pre">(etag)</span></tt></dt>
-<dd>When passed a quoted tag it will check if this tag is part of the set.
-If the tag is weak it is checked against weak and strong tags, otherwise
-weak only.</dd>
+<dd>When passed a quoted tag it will check if this tag is part of the
+set.  If the tag is weak it is checked against weak and strong tags,
+otherwise weak only.</dd>
 </dl>
 <dl>
 <dt><cite id="werkzeug.http.ETags.as_set">as_set</cite> <tt class="func-signature docutils literal"><span class="pre">(include_weak=False)</span></tt></dt>
 </dl>
 <dl>
 <dt><strong>class</strong> <cite id="werkzeug.http.Authorization">Authorization</cite></dt>
-<dd><p class="first">Represents an <cite>Authorization</cite> header sent by the client.  You should not
-create this kind of object yourself but use it when it&#8217;s returned by the
-<cite>parse_authorization_header</cite> function.</p>
+<dd><p class="first">Represents an <cite>Authorization</cite> header sent by the client.  You should
+not create this kind of object yourself but use it when it&#8217;s returned by
+the <cite>parse_authorization_header</cite> function.</p>
 <p>This object is a dict subclass and can be altered by setting dict items
 but it should be considered immutable as it&#8217;s returned by the client and
 not meant for modifications.</p>
 </dl>
 <dl>
 <dt><cite id="werkzeug.http.parse_www_authenticate_header">parse_www_authenticate_header</cite> <tt class="func-signature docutils literal"><span class="pre">(value,</span> <span class="pre">on_update=None)</span></tt></dt>
-<dd>Parse an HTTP WWW-Authenticate header into a <cite>WWWAuthenticate</cite> object.</dd>
+<dd>Parse an HTTP WWW-Authenticate header into a <cite>WWWAuthenticate</cite>
+object.</dd>
 </dl>
 <dl>
 <dt><cite>HTTP_STATUS_CODES</cite></dt>
 <div class="section">
 <h3 id="url-helpers">URL Helpers</h3>
 <dl>
-<dt><cite id="werkzeug.utils.url_decode">url_decode</cite> <tt class="func-signature docutils literal"><span class="pre">(s,</span> <span class="pre">charset='utf-8',</span> <span class="pre">decode_keys=False,</span> <span class="pre">include_empty=True)</span></tt></dt>
-<dd><p class="first">Parse a querystring and return it as <cite>MultiDict</cite>.  Per default only values
-are decoded into unicode strings.  If <cite>decode_keys</cite> is set to <tt class="docutils literal"><span class="pre">True</span></tt> the
-same will happen for keys.</p>
-<p class="last">Per default a missing value for a key will default to an empty key.  If
+<dt><cite id="werkzeug.utils.url_decode">url_decode</cite> <tt class="func-signature docutils literal"><span class="pre">(s,</span> <span class="pre">charset='utf-8',</span> <span class="pre">decode_keys=False,</span> <span class="pre">include_empty=True,</span> <span class="pre">errors='ignore')</span></tt></dt>
+<dd><p class="first">Parse a querystring and return it as <cite>MultiDict</cite>.  Per default only
+values are decoded into unicode strings.  If <cite>decode_keys</cite> is set to
+<tt class="docutils literal"><span class="pre">True</span></tt> the same will happen for keys.</p>
+<p>Per default a missing value for a key will default to an empty key.  If
 you don&#8217;t want that behavior you can set <cite>include_empty</cite> to <cite>False</cite>.</p>
+<p class="last">Per default encoding errors are ignore.  If you want a different behavior
+you can set <cite>errors</cite> to <tt class="docutils literal"><span class="pre">'replace'</span></tt> or <tt class="docutils literal"><span class="pre">'strict'</span></tt>.  In strict mode a
+<cite>HTTPUnicodeError</cite> is raised.</p>
 </dd>
 </dl>
 <dl>
 <dt><cite id="werkzeug.utils.url_encode">url_encode</cite> <tt class="func-signature docutils literal"><span class="pre">(obj,</span> <span class="pre">charset='utf-8',</span> <span class="pre">encode_keys=False)</span></tt></dt>
-<dd>URL encode a dict/<cite>MultiDict</cite>.  If a value is <cite>None</cite> it will not appear in
-the result string.  Per default only values are encoded into the target
+<dd>URL encode a dict/<cite>MultiDict</cite>.  If a value is <cite>None</cite> it will not appear
+in the result string.  Per default only values are encoded into the target
 charset strings.  If <cite>encode_keys</cite> is set to <tt class="docutils literal"><span class="pre">True</span></tt> unicode keys are
 supported too.</dd>
 </dl>
 whitespace to &#8220;+&#8221;.</dd>
 </dl>
 <dl>
-<dt><cite id="werkzeug.utils.url_unquote">url_unquote</cite> <tt class="func-signature docutils literal"><span class="pre">(s,</span> <span class="pre">charset='utf-8')</span></tt></dt>
-<dd>URL decode a single string with a given decoding.</dd>
+<dt><cite id="werkzeug.utils.url_unquote">url_unquote</cite> <tt class="func-signature docutils literal"><span class="pre">(s,</span> <span class="pre">charset='utf-8',</span> <span class="pre">errors='ignore')</span></tt></dt>
+<dd><p class="first">URL decode a single string with a given decoding.</p>
+<p class="last">Per default encoding errors are ignore.  If you want a different behavior
+you can set <cite>errors</cite> to <tt class="docutils literal"><span class="pre">'replace'</span></tt> or <tt class="docutils literal"><span class="pre">'strict'</span></tt>.  In strict mode a
+<cite>HTTPUnicodeError</cite> is raised.</p>
+</dd>
 </dl>
 <dl>
-<dt><cite id="werkzeug.utils.url_unquote_plus">url_unquote_plus</cite> <tt class="func-signature docutils literal"><span class="pre">(s,</span> <span class="pre">charset='utf-8')</span></tt></dt>
-<dd>URL decode a single string with the given decoding and decode
-a &#8220;+&#8221; to whitespace.</dd>
+<dt><cite id="werkzeug.utils.url_unquote_plus">url_unquote_plus</cite> <tt class="func-signature docutils literal"><span class="pre">(s,</span> <span class="pre">charset='utf-8',</span> <span class="pre">errors='ignore')</span></tt></dt>
+<dd><p class="first">URL decode a single string with the given decoding and decode
+a &#8220;+&#8221; to whitespace.</p>
+<p class="last">Per default encoding errors are ignore.  If you want a different behavior
+you can set <cite>errors</cite> to <tt class="docutils literal"><span class="pre">'replace'</span></tt> or <tt class="docutils literal"><span class="pre">'strict'</span></tt>.  In strict mode a
+<cite>HTTPUnicodeError</cite> is raised.</p>
+</dd>
 </dl>
 <dl>
 <dt><cite id="werkzeug.utils.url_fix">url_fix</cite> <tt class="func-signature docutils literal"><span class="pre">(s,</span> <span class="pre">charset='utf-8')</span></tt></dt>
 <div class="section">
 <h3 id="html-helpers">HTML Helpers</h3>
 <dl>
-<dt><cite id="werkzeug.utils.escape">escape</cite> <tt class="func-signature docutils literal"><span class="pre">(s,</span> <span class="pre">quote=None)</span></tt></dt>
-<dd><p class="first">Replace special characters &#8220;&amp;&#8221;, &#8220;&lt;&#8221; and &#8220;&gt;&#8221; to HTML-safe sequences.  If the
-optional flag <cite>quote</cite> is <cite>True</cite>, the quotation mark character (&#8220;) is also
-translated.</p>
+<dt><cite id="werkzeug.utils.escape">escape</cite> <tt class="func-signature docutils literal"><span class="pre">(s,</span> <span class="pre">quote=False)</span></tt></dt>
+<dd><p class="first">Replace special characters &#8220;&amp;&#8221;, &#8220;&lt;&#8221; and &#8220;&gt;&#8221; to HTML-safe sequences.  If
+the optional flag <cite>quote</cite> is <cite>True</cite>, the quotation mark character (&#8220;) is
+also translated.</p>
 <p class="last">There is a special handling for <cite>None</cite> which escapes to an empty string.</p>
 </dd>
 </dl>
 <dl>
 <dt><cite id="werkzeug.utils.unescape">unescape</cite> <tt class="func-signature docutils literal"><span class="pre">(s)</span></tt></dt>
-<dd>The reverse function of <cite>escape</cite>.  This unescapes all the HTML entities,
-not only the XML entities inserted by <cite>escape</cite>.</dd>
+<dd>The reverse function of <cite>escape</cite>.  This unescapes all the HTML
+entities, not only the XML entities inserted by <cite>escape</cite>.</dd>
 </dl>
 <dl>
 <dt><strong>class</strong> <cite id="werkzeug.utils.HTMLBuilder">HTMLBuilder</cite></dt>
 <h3 id="wsgi-helpers">WSGI Helpers</h3>
 <dl>
 <dt><strong>class</strong> <cite id="werkzeug.utils.ClosingIterator">ClosingIterator</cite></dt>
-<dd><p class="first">The WSGI specification requires that all middlewares and gateways respect the
-<cite>close</cite> callback of an iterator.  Because it is useful to add another close
-action to a returned iterator and adding a custom iterator is a boring task
-this class can be used for that:</p>
+<dd><p class="first">The WSGI specification requires that all middlewares and gateways
+respect the <cite>close</cite> callback of an iterator.  Because it is useful to add
+another close action to a returned iterator and adding a custom iterator
+is a boring task this class can be used for that:</p>
 <div class="syntax"><pre><span class="k">return</span> <span class="n">ClosingIterator</span><span class="p">(</span><span class="n">app</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="p">[</span><span class="n">cleanup_session</span><span class="p">,</span>
                                                       <span class="n">cleanup_locals</span><span class="p">])</span>
 </pre></div>
 </dl>
 <dl>
 <dt><cite id="werkzeug.utils.FileStorage.__init__">__init__</cite> <tt class="func-signature docutils literal"><span class="pre">(stream=None,</span> <span class="pre">filename=None,</span> <span class="pre">name=None,</span> <span class="pre">content_type='application/octet-stream',</span> <span class="pre">content_length=-1)</span></tt></dt>
-<dd><p class="first">Creates a new <cite>FileStorage</cite> object.  The constructor looked different
-for Werkzeug 0.1 but there the object was only used internally.</p>
+<dd><p class="first">Creates a new <cite>FileStorage</cite> object.</p>
 <dl class="last">
 <dt>Parameters</dt>
 <dd><p class="first"><strong>stream</strong>: the input stream for uploaded file.  Usually this
 <dl>
 <dt><cite id="werkzeug.utils.create_environ">create_environ</cite> <tt class="func-signature docutils literal"><span class="pre">(path='/',</span> <span class="pre">base_url=None,</span> <span class="pre">query_string=None,</span> <span class="pre">method='GET',</span> <span class="pre">input_stream=None,</span> <span class="pre">content_type=None,</span> <span class="pre">content_length=0,</span> <span class="pre">errors_stream=None,</span> <span class="pre">multithread=False,</span> <span class="pre">multiprocess=False,</span> <span class="pre">run_once=False)</span></tt></dt>
 <dd><p class="first">Create a new WSGI environ dict based on the values passed.  The first
-parameter should be the path of the request which defaults to &#8216;/&#8217;.
-The second one can either be a absolute path (in that case the URL
-host is localhost:80) or a full path to the request with scheme,
-netloc port and the path to the script.</p>
+parameter should be the path of the request which defaults to &#8216;/&#8217;.  The
+second one can either be a absolute path (in that case the host is
+localhost:80) or a full path to the request with scheme, netloc port and
+the path to the script.</p>
 <p>If the <cite>path</cite> contains a query string it will be used, even if the
 <cite>query_string</cite> parameter was given.  If it does not contain one
 the <cite>query_string</cite> parameter is used as querystring.  In that case
 </dl>
 <dl>
 <dt><cite id="werkzeug.utils.run_wsgi_app">run_wsgi_app</cite> <tt class="func-signature docutils literal"><span class="pre">(app,</span> <span class="pre">environ,</span> <span class="pre">buffered=False)</span></tt></dt>
-<dd><p class="first">Return a tuple in the form (app_iter, status, headers) of the application
-output.  This works best if you pass it an application that returns a
-iterator all the time.</p>
+<dd><p class="first">Return a tuple in the form (app_iter, status, headers) of the
+application output.  This works best if you pass it an application that
+returns a iterator all the time.</p>
 <p>Sometimes applications may use the <cite>write()</cite> callable returned
 by the <cite>start_response</cite> function.  This tries to resolve such edge
 cases automatically.  But if you don&#8217;t get the expected output you
 </dd>
 </dl>
 <dl>
-<dt><cite id="werkzeug.utils.environ_property">environ_property</cite> <tt class="func-signature docutils literal"><span class="pre">(name,</span> <span class="pre">default=None,</span> <span class="pre">load_func=None,</span> <span class="pre">dump_func=None,</span> <span class="pre">read_only=False,</span> <span class="pre">doc=None)</span></tt></dt>
+<dt><cite id="werkzeug.utils.environ_property">environ_property</cite> <tt class="func-signature docutils literal"><span class="pre">(name,</span> <span class="pre">default=None,</span> <span class="pre">load_func=None,</span> <span class="pre">dump_func=None,</span> <span class="pre">read_only=None,</span> <span class="pre">doc=None)</span></tt></dt>
 <dd><p class="first">Maps request attributes to environment variables. This works not only
 for the Werzeug request object, but also any other class with an
 environ attribute:</p>
 exist, the third one can be a converter that takes a value and converts
 it.  If it raises <cite>ValueError</cite> or <cite>TypeError</cite> the default value is used.
 If no default value is provided <cite>None</cite> is used.</p>
-<p class="last">Per default the property works in two directions, but if you set
-<cite>read_only</cite> to False it will block set/delete.</p>
+<p class="last">Per default the property is read only.  You have to explicitly enable it
+by passing <tt class="docutils literal"><span class="pre">read_only=False</span></tt> to the constructor.</p>
 </dd>
 </dl>
 <dl>
-<dt><cite id="werkzeug.utils.header_property">header_property</cite> <tt class="func-signature docutils literal"><span class="pre">(name,</span> <span class="pre">default=None,</span> <span class="pre">load_func=None,</span> <span class="pre">dump_func=None,</span> <span class="pre">read_only=False,</span> <span class="pre">doc=None)</span></tt></dt>
+<dt><cite id="werkzeug.utils.header_property">header_property</cite> <tt class="func-signature docutils literal"><span class="pre">(name,</span> <span class="pre">default=None,</span> <span class="pre">load_func=None,</span> <span class="pre">dump_func=None,</span> <span class="pre">read_only=None,</span> <span class="pre">doc=None)</span></tt></dt>
 <dd>Like <cite>environ_property</cite> but for headers.</dd>
 </dl>
 <dl>
-<dt><cite id="werkzeug.utils.cookie_date">cookie_date</cite> <tt class="func-signature docutils literal"><span class="pre">(expires=None,</span> <span class="pre">_date_delim='-')</span></tt></dt>
-<dd><p class="first">Formats the time to ensure compatibility with Netscape&#8217;s cookie standard.</p>
-<p>Accepts a floating point number expressed in seconds since the epoc in, a
-datetime object or a timetuple.  All times in UTC.  The <cite>parse_date</cite>
-function in <cite>werkzeug.http</cite> can be used to parse such a date.</p>
-<p class="last">Outputs a string in the format <tt class="docutils literal"><span class="pre">Wdy,</span> <span class="pre">DD-Mon-YYYY</span> <span class="pre">HH:MM:SS</span> <span class="pre">GMT</span></tt>.</p>
+<dt><cite id="werkzeug.utils.parse_cookie">parse_cookie</cite> <tt class="func-signature docutils literal"><span class="pre">(header,</span> <span class="pre">charset='utf-8',</span> <span class="pre">errors='ignore')</span></tt></dt>
+<dd><p class="first">Parse a cookie.  Either from a string or WSGI environ.</p>
+<p class="last">Per default encoding errors are ignore.  If you want a different behavior
+you can set <cite>errors</cite> to <tt class="docutils literal"><span class="pre">'replace'</span></tt> or <tt class="docutils literal"><span class="pre">'strict'</span></tt>.  In strict mode a
+<cite>HTTPUnicodeError</cite> is raised.</p>
 </dd>
 </dl>
 <dl>
-<dt><cite id="werkzeug.utils.http_date">http_date</cite> <tt class="func-signature docutils literal"><span class="pre">(timestamp=None)</span></tt></dt>
-<dd><p class="first">Formats the time to match the RFC1123 date format.</p>
-<p>Accepts a floating point number expressed in seconds since the epoc in, a
-datetime object or a timetuple.  All times in UTC.  The <cite>parse_date</cite>
-function in <cite>werkzeug.http</cite> can be used to parse such a date.</p>
-<p class="last">Outputs a string in the format <tt class="docutils literal"><span class="pre">Wdy,</span> <span class="pre">DD</span> <span class="pre">Mon</span> <span class="pre">YYYY</span> <span class="pre">HH:MM:SS</span> <span class="pre">GMT</span></tt>.</p>
-</dd>
-</dl>
-<dl>
-<dt><cite id="werkzeug.utils.parse_cookie">parse_cookie</cite> <tt class="func-signature docutils literal"><span class="pre">(header,</span> <span class="pre">charset='utf-8')</span></tt></dt>
-<dd>Parse a cookie.  Either from a string or WSGI environ.</dd>
-</dl>
-<dl>
 <dt><cite id="werkzeug.utils.dump_cookie">dump_cookie</cite> <tt class="func-signature docutils literal"><span class="pre">(key,</span> <span class="pre">value='',</span> <span class="pre">max_age=None,</span> <span class="pre">expires=None,</span> <span class="pre">path='/',</span> <span class="pre">domain=None,</span> <span class="pre">secure=None,</span> <span class="pre">httponly=False,</span> <span class="pre">charset='utf-8',</span> <span class="pre">sync_expires=True)</span></tt></dt>
 <dd><p class="first">Creates a new Set-Cookie header without the <tt class="docutils literal"><span class="pre">Set-Cookie</span></tt> prefix
 The parameters are the same as in the cookie Morsel object in the
 </dl>
 <dl>
 <dt><cite id="werkzeug.utils.redirect">redirect</cite> <tt class="func-signature docutils literal"><span class="pre">(location,</span> <span class="pre">code=302)</span></tt></dt>
-<dd>Return a response object (a WSGI application) that, if called, redirects
-the client to the target location.  Supported codes are 301, 302, 303,
-305, and 307.  300 is not supported because it&#8217;s not a real redirect and
-304 because it&#8217;s the answer for a request with a request with defined
-If-Modified-Since headers.</dd>
+<dd>Return a response object (a WSGI application) that, if called,
+redirects the client to the target location.  Supported codes are 301,
+302, 303, 305, and 307.  300 is not supported because it&#8217;s not a real
+redirect and 304 because it&#8217;s the answer for a request with a request
+with defined If-Modified-Since headers.</dd>
 </dl>
 <dl>
 <dt><cite id="werkzeug.utils.append_slash_redirect">append_slash_redirect</cite> <tt class="func-signature docutils literal"><span class="pre">(environ,</span> <span class="pre">code=301)</span></tt></dt>
 </dl>
 <dl>
 <dt><cite id="werkzeug.utils.import_string">import_string</cite> <tt class="func-signature docutils literal"><span class="pre">(import_name,</span> <span class="pre">silent=False)</span></tt></dt>
-<dd><p class="first">Imports an object based on a string.  This use useful if you want to use
-import paths as endpoints or something similar.  An import path can
+<dd><p class="first">Imports an object based on a string.  This use useful if you want to
+use import paths as endpoints or something similar.  An import path can
 be specified either in dotted notation (<tt class="docutils literal"><span class="pre">xml.sax.saxutils.escape</span></tt>)
 or with a colon as object delimiter (<tt class="docutils literal"><span class="pre">xml.sax.saxutils:escape</span></tt>).</p>
 <p>If the <cite>silent</cite> is True the return value will be <cite>None</cite> if the import
 </dl>
 <dl>
 <dt><cite id="werkzeug.utils.find_modules">find_modules</cite> <tt class="func-signature docutils literal"><span class="pre">(import_path,</span> <span class="pre">include_packages=False,</span> <span class="pre">recursive=False)</span></tt></dt>
-<dd><p class="first">Find all the modules below a package.  This can be useful to automatically
-import all views / controllers so that their metaclasses / function
-decorators have a chance to register themselves on the application.</p>
+<dd><p class="first">Find all the modules below a package.  This can be useful to
+automatically import all views / controllers so that their metaclasses /
+function decorators have a chance to register themselves on the
+application.</p>
 <p>Packages are not returned unless <cite>include_packages</cite> is <cite>True</cite>.  This can
 also recursively list modules but in that case it will import all the
 packages to get the correct load path of that module.</p>
 </dd>
 </dl>
 <dl>
+<dt><cite id="werkzeug.utils.validate_arguments">validate_arguments</cite> <tt class="func-signature docutils literal"><span class="pre">(func,</span> <span class="pre">args,</span> <span class="pre">kwargs,</span> <span class="pre">drop_extra=True)</span></tt></dt>
+<dd><p class="first">Check if the function accepts the arguments and keyword arguments.
+Returns a new <tt class="docutils literal"><span class="pre">(args,</span> <span class="pre">kwargs)</span></tt> tuple that can savely be passed to
+the function without causing a <cite>TypeError</cite> because the function signature
+is incompatible.  If <cite>drop_extra</cite> is set to <cite>True</cite> (which is the default)
+any extra positional or keyword arguments are dropped automatically.</p>
+<p>The exception raised provides three attributes:</p>
+<dl>
+<dt><cite>missing</cite></dt>
+<dd>A set of argument names that the function expected but where
+missing.</dd>
+<dt><cite>extra</cite></dt>
+<dd>A dict of keyword arguments that the function can not handle but
+where provided.</dd>
+<dt><cite>extra_positional</cite></dt>
+<dd>A list of values that where given by positional argument but the
+function cannot accept.</dd>
+</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>
+
+<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>
+        <span class="n">data</span> <span class="o">=</span> <span class="n">request</span><span class="o">.</span><span class="n">values</span><span class="o">.</span><span class="n">to_dict</span><span class="p">()</span>
+        <span class="k">try</span><span class="p">:</span>
+            <span class="n">args</span><span class="p">,</span> <span class="n">kwargs</span> <span class="o">=</span> <span class="n">validate_arguments</span><span class="p">(</span><span class="n">f</span><span class="p">,</span> <span class="p">(</span><span class="n">request</span><span class="p">,),</span> <span class="n">data</span><span class="p">)</span>
+        <span class="k">except</span> <span class="n">ArgumentValidationError</span><span class="p">:</span>
+            <span class="k">raise</span> <span class="n">BadRequest</span><span class="p">(</span><span class="s">&#39;The browser failed to transmit all &#39;</span>
+                             <span class="s">&#39;the data expected.&#39;</span><span class="p">)</span>
+        <span class="k">return</span> <span class="n">f</span><span class="p">(</span><span class="o">*</span><span class="n">args</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span>
+    <span class="k">return</span> <span class="n">proxy</span>
+</pre></div>
+</dd>
+</dl>
+<dl>
+<dt><cite id="werkzeug.utils.bind_arguments">bind_arguments</cite> <tt class="func-signature docutils literal"><span class="pre">(func,</span> <span class="pre">args,</span> <span class="pre">kwargs)</span></tt></dt>
+<dd>Bind the arguments provided into a dict.  When passed a function,
+a tuple of arguments and a dict of keyword arguments <cite>bind_arguments</cite>
+returns a dict of names as the function would see it.  This can be useful
+to implement a cache decorator that uses the function arguments to build
+the cache key based on the values of the arguments.</dd>
+</dl>
+<dl>
 <dt><cite id="werkzeug.testapp.test_app">test_app</cite> <tt class="func-signature docutils literal"><span class="pre">(environ,</span> <span class="pre">start_response)</span></tt></dt>
 <dd>Simple test application that dumps the environment.</dd>
 </dl>

docs/build/wrappers.html

 <p>Request objects should be considered <em>read only</em>.  Even though the object
 doesn&#8217;t enforce read only access everywhere you should never modify any
 data on the object itself unless you know exactly what you are doing.</p>
+<p>Per default the request object will assume all the text data is <cite>utf-8</cite>
+encoded.  Please refer to <a class="reference" href="unicode.html">the unicode chapter</a> for more
+details about customizing the behavior.</p>
 <p><strong>Creating Request Objects</strong></p>
 <dl>
-<dt><cite id="werkzeug.wrappers.BaseRequest.__init__">__init__</cite> <tt class="func-signature docutils literal"><span class="pre">(environ,</span> <span class="pre">populate_request=True)</span></tt></dt>
-<dd>Per default the request object will be added to the WSGI enviornment
-as <cite>werkzeug.request</cite> to support the debugging system.  If you don&#8217;t
-want that, set <cite>populate_request</cite> to <cite>False</cite>.</dd>
+<dt><cite id="werkzeug.wrappers.BaseRequest.__init__">__init__</cite> <tt class="func-signature docutils literal"><span class="pre">(environ,</span> <span class="pre">populate_request=True,</span> <span class="pre">shallow=False)</span></tt></dt>
+<dd><p class="first">Per default the request object will be added to the WSGI
+enviornment as <cite>werkzeug.request</cite> to support the debugging system.
+If you don&#8217;t want that, set <cite>populate_request</cite> to <cite>False</cite>.</p>
+<p class="last">If <cite>shallow</cite> is <cite>True</cite> the environment is initialized as shallow
+object around the environ.  Every operation that would modify the
+environ in any way (such as consuming form data) raises an exception
+unless the <cite>shallow</cite> attribute is explicitly set to <cite>False</cite>.  This
+is useful for middlewares where you don&#8217;t want to consume the form
+data by accident.  A shallow request is not populated to the WSGI
+environment.</p>
+</dd>
 </dl>
 <dl>
 <dt><cite id="werkzeug.wrappers.BaseRequest.from_values">from_values</cite> <tt class="func-signature docutils literal"><span class="pre">(path='/',</span> <span class="pre">base_url=None,</span> <span class="pre">query_string=None,</span> <span class="pre">**options)</span></tt></dt>
-<dd><p class="first">Create a new request object based on the values provided.  If environ
-is given missing values are filled from there.  This method is useful
-for small scripts when you need to simulate a request from an URL.  Do
-not use this method for unittesting, there is a full featured client
+<dd><p class="first">Create a new request object based on the values provided.  If
+environ is given missing values are filled from there.  This method is
+useful for small scripts when you need to simulate a request from an URL.
+Do not use this method for unittesting, there is a full featured client
 object in <cite>werkzeug.test</cite> that allows to create multipart requests
 etc.</p>
 <p>This accepts the same options as the <cite>create_environ</cite> function from the
 <p class="last"><strong>returns</strong>: request object</p>
 </dd>
 </dl>
+<dl>
+<dt><cite id="werkzeug.wrappers.BaseRequest.application">application</cite> <tt class="func-signature docutils literal"><span class="pre">(f)</span></tt></dt>
+<dd><p class="first">Decorate a function as responder that accepts the request as
+first argument.  This works like the <cite>responder</cite> decorator but
+the function is passed the request object as first argument:</p>
+<div class="syntax"><pre><span class="nd">@Request</span><span class="o">.</span><span class="n">application</span>
+<span class="k">def</span> <span class="nf">my_wsgi_app</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 World!&#39;</span><span class="p">)</span>
+</pre></div>
+</dd>
+</dl>
 <p><strong>Properties</strong></p>
 <dl class="last">
 <dt><cite>path</cite></dt>
 </dl>
 <dl>
 <dt><strong>class</strong> <cite id="werkzeug.wrappers.BaseResponse">BaseResponse</cite></dt>
-<dd><p class="first">Base response class.  The most important fact about a response object is
-that it&#8217;s a regular WSGI application.  It&#8217;s initialized with a couple of
-response parameters (headers, body, status code etc.) and will start a
+<dd><p class="first">Base response class.  The most important fact about a response object
+is that it&#8217;s a regular WSGI application.  It&#8217;s initialized with a couple
+of response parameters (headers, body, status code etc.) and will start a
 valid WSGI response when called with the environ and start response
 callable.</p>
 <p>Because it&#8217;s a WSGI application itself processing usually ends before the
 <cite>force_type</cite> method.  This is useful if you&#8217;re working with different
 subclasses of response objects and you want to post process them with a
 know interface.</p>
+<p>Per default the request object will assume all the text data is <cite>utf-8</cite>
+encoded.  Please refer to <a class="reference" href="unicode.html">the unicode chapter</a> for more
+details about customizing the behavior.</p>
 <p><strong>Creating Response Objects</strong></p>
 <dl>
 <dt><cite id="werkzeug.wrappers.BaseResponse.__init__">__init__</cite> <tt class="func-signature docutils literal"><span class="pre">(response=None,</span> <span class="pre">status=None,</span> <span class="pre">headers=None,</span> <span class="pre">mimetype=None,</span> <span class="pre">content_type=None)</span></tt></dt>
-<dd><p class="first">Response can be any kind of iterable or string.  If it&#8217;s a string it&#8217;s
-considered being an iterable with one item which is the string passed.
-headers can be a list of tuples or a <cite>Headers</cite> object.</p>
+<dd><p class="first">Response can be any kind of iterable or string.  If it&#8217;s a string
+it&#8217;s considered being an iterable with one item which is the string
+passed.  Headers can be a list of tuples or a <cite>Headers</cite> object.</p>
 <p class="last">Special note for <cite>mimetype</cite> and <cite>content_type</cite>.  For most mime types
 <cite>mimetype</cite> and <cite>content_type</cite> work the same, the difference affects
 only &#8216;text&#8217; mimetypes.  If the mimetype passed with <cite>mimetype</cite> is a
 <span class="c"># MyResponseClass subclass.</span>
 <span class="n">response</span> <span class="o">=</span> <span class="n">MyResponseClass</span><span class="o">.</span><span class="n">force_type</span><span class="p">(</span><span class="n">response</span><span class="p">)</span>
 
-<span class="c"># convert any WSGI application into a request object</span>
+<span class="c"># convert any WSGI application into a response object</span>
 <span class="n">response</span> <span class="o">=</span> <span class="n">MyResponseClass</span><span class="o">.</span><span class="n">force_type</span><span class="p">(</span><span class="n">response</span><span class="p">,</span> <span class="n">environ</span><span class="p">)</span>
 </pre></div>
 <p>This is especially useful if you want to post-process responses in
 </dl>
 <dl>
 <dt><cite id="werkzeug.wrappers.BaseResponse.from_app">from_app</cite> <tt class="func-signature docutils literal"><span class="pre">(app,</span> <span class="pre">environ,</span> <span class="pre">buffered=False)</span></tt></dt>
-<dd>Create a new response object from an application output.  This works
-best if you pass it an application that returns a generator all the
-time.  Sometimes applications may use the <cite>write()</cite> callable returned
-by the <cite>start_response</cite> function.  This tries to resolve such edge
-cases automatically.  But if you don&#8217;t get the expected output you
-should set <cite>buffered</cite> to <cite>True</cite> which enforces buffering.</dd>
+<dd>Create a new response object from an application output.  This
+works best if you pass it an application that returns a generator all
+the time.  Sometimes applications may use the <cite>write()</cite> callable
+returned by the <cite>start_response</cite> function.  This tries to resolve such
+edge cases automatically.  But if you don&#8217;t get the expected output
+you should set <cite>buffered</cite> to <cite>True</cite> which enforces buffering.</dd>
 </dl>
 <p><strong>Properties</strong></p>
 <dl>
 </dl>
 <dl>
 <dt><cite id="werkzeug.wrappers.AcceptMixin.accept_encodings">accept_encodings</cite></dt>
-<dd>List of encodings this client accepts.  Encodings in a HTTP term are
-compression encodings such as gzip.  For charsets have a look at
+<dd>List of encodings this client accepts.  Encodings in a HTTP term
+are compression encodings such as gzip.  For charsets have a look at
 <cite>accept_charset</cite>.</dd>
 </dl>
 <dl>
 </dd>
 </dl>
 <dl>
+<dt><strong>class</strong> <cite id="werkzeug.wrappers.AuthorizationMixin">AuthorizationMixin</cite></dt>
+<dd><p class="first">Adds an <cite>authorization</cite> property that represents the parsed value of
+the <cite>Authorization</cite> header as <cite>Authorization</cite> object.</p>
+<dl class="last">
+<dt><cite id="werkzeug.wrappers.AuthorizationMixin.authorization">authorization</cite></dt>
+<dd>The <cite>Authorization</cite> object in parsed form.</dd>
+</dl>
+</dd>
+</dl>
+<dl>
 <dt><strong>class</strong> <cite id="werkzeug.wrappers.ETagRequestMixin">ETagRequestMixin</cite></dt>
 <dd><p class="first">Add entity tag and cache descriptors to a request object or object with
 an WSGI environment available as <cite>environ</cite>.  This not only provides
 object that implements a dict like interface similar to <cite>Headers</cite>.</p>
 <dl>
 <dt><cite id="werkzeug.wrappers.ETagResponseMixin.cache_control">cache_control</cite></dt>
-<dd>The Cache-Control general-header field is used to specify directives
-that MUST be obeyed by all caching mechanisms along the
+<dd>The Cache-Control general-header field is used to specify
+directives that MUST be obeyed by all caching mechanisms along the
 request/response chain.</dd>
 </dl>
 <dl>
 <dt><cite id="werkzeug.wrappers.ETagResponseMixin.make_conditional">make_conditional</cite> <tt class="func-signature docutils literal"><span class="pre">(request_or_environ)</span></tt></dt>
-<dd><p class="first">Make the response conditional to the request.  This method works best
-if an etag was defined for the response already.  The <cite>add_etag</cite>
+<dd><p class="first">Make the response conditional to the request.  This method works
+best if an etag was defined for the response already.  The <cite>add_etag</cite>
 method can be used to do that.  If called without etag just the date
 header is set.</p>
 <p>This does nothing if the request method in the request or enviorn is
 </dl>
 <dl>
 <dt><strong>class</strong> <cite id="werkzeug.wrappers.ResponseStreamMixin">ResponseStreamMixin</cite></dt>
-<dd><p class="first">Mixin for <cite>BaseRequest</cite> subclasses.  Classes that inherit from this mixin
-will automatically get a <cite>stream</cite> property that provides a write-only
-interface to the response iterable.</p>
+<dd><p class="first">Mixin for <cite>BaseRequest</cite> subclasses.  Classes that inherit from this
+mixin will automatically get a <cite>stream</cite> property that provides a
+write-only interface to the response iterable.</p>
 <dl class="last">
 <dt><cite id="werkzeug.wrappers.ResponseStreamMixin.stream">stream</cite></dt>
 <dd>The response iterable as write-only stream.</dd>
 </dl>
 </dd>
 </dl>
+<dl>
+<dt><strong>class</strong> <cite id="werkzeug.wrappers.WWWAuthenticateMixin">WWWAuthenticateMixin</cite></dt>
+<dd><p class="first">Adds a <cite>www_authenticate</cite> property to a response object.</p>
+<dl class="last">
+<dt><cite id="werkzeug.wrappers.WWWAuthenticateMixin.www_authenticate">www_authenticate</cite></dt>
+<dd>The <tt class="docutils literal"><span class="pre">WWW-Authenticate</span></tt> header in a parsed form.</dd>
+</dl>
+</dd>
+</dl>
 </div>
 <div class="section">
 <h3 id="note-on-file-uploads">Note on File Uploads</h3>

docs/src/api_stability.txt

 
 `0.3`
     -   Werkzeug 0.3 will be the last release with Python 2.3 compatibility.
+    -   The `environ_property` is now read-only by default.  This decision was
+        made because the request in general should be considered read-only.
 
 `0.2`
     -   The `BaseReporterStream` is now part of the contrib module, the
 
 from setuptools import setup, Feature
 
+
+data_files = []
+documentation_path = 'docs/build'
+if os.path.exists(documentation_path):
+    documentation_files = []
+    for fn in os.listdir(documentation_path):
+        if not fn.startswith('.'):
+            fn = os.path.join(documentation_path, fn)
+            if os.path.isfile(fn):
+                documentation_files.append(fn)
+    data_files.append(('docs', documentation_files))
+
+
 setup(
     name='Werkzeug',
     version='0.3',
         'Topic :: Software Development :: Libraries :: Python Modules'
     ],
     packages=['werkzeug', 'werkzeug.debug'],
+    data_files=data_files,
     package_data={
         'werkzeug.debug': ['shared/*', 'templates/*']
     },