%PDF- %PDF-
Direktori : /usr/share/doc/python3-routes/html/modules/ |
Current File : //usr/share/doc/python3-routes/html/modules/middleware.html |
<!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.17.1: http://docutils.sourceforge.net/" /> <title>routes.middleware – Routes WSGI Middleware — Routes 2.5.0 documentation</title> <link rel="stylesheet" type="text/css" href="../_static/pygments.css" /> <link rel="stylesheet" type="text/css" href="../_static/classic.css" /> <script data-url_root="../" id="documentation_options" src="../_static/documentation_options.js"></script> <script src="../_static/jquery.js"></script> <script src="../_static/underscore.js"></script> <script src="../_static/doctools.js"></script> <link rel="index" title="Index" href="../genindex.html" /> <link rel="search" title="Search" href="../search.html" /> <link rel="next" title="routes.util – URL Generator and utility functions" href="util.html" /> <link rel="prev" title="routes.route – Route" href="route.html" /> </head><body> <div class="related" role="navigation" aria-label="related navigation"> <h3>Navigation</h3> <ul> <li class="right" style="margin-right: 10px"> <a href="../genindex.html" title="General Index" accesskey="I">index</a></li> <li class="right" > <a href="../py-modindex.html" title="Python Module Index" >modules</a> |</li> <li class="right" > <a href="util.html" title="routes.util – URL Generator and utility functions" accesskey="N">next</a> |</li> <li class="right" > <a href="route.html" title="routes.route – Route" accesskey="P">previous</a> |</li> <li class="nav-item nav-item-0"><a href="../index.html">Routes 2.5.0 documentation</a> »</li> <li class="nav-item nav-item-1"><a href="index.html" accesskey="U">Routes Modules</a> »</li> <li class="nav-item nav-item-this"><a href=""><code class="xref py py-mod docutils literal notranslate"><span class="pre">routes.middleware</span></code> – Routes WSGI Middleware</a></li> </ul> </div> <div class="document"> <div class="documentwrapper"> <div class="bodywrapper"> <div class="body" role="main"> <section id="module-routes.middleware"> <span id="routes-middleware-routes-wsgi-middleware"></span><h1><a class="reference internal" href="#module-routes.middleware" title="routes.middleware"><code class="xref py py-mod docutils literal notranslate"><span class="pre">routes.middleware</span></code></a> – Routes WSGI Middleware<a class="headerlink" href="#module-routes.middleware" title="Permalink to this headline">¶</a></h1> <p>Routes WSGI Middleware</p> <section id="module-contents"> <h2>Module Contents<a class="headerlink" href="#module-contents" title="Permalink to this headline">¶</a></h2> <dl class="py class"> <dt class="sig sig-object py" id="routes.middleware.RoutesMiddleware"> <em class="property"><span class="pre">class</span><span class="w"> </span></em><span class="sig-prename descclassname"><span class="pre">routes.middleware.</span></span><span class="sig-name descname"><span class="pre">RoutesMiddleware</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">wsgi_app</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">mapper</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">use_method_override</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">path_info</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">singleton</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#routes.middleware.RoutesMiddleware" title="Permalink to this definition">¶</a></dt> <dd><p>Routing middleware that handles resolving the PATH_INFO in addition to optionally recognizing method overriding.</p> <div class="admonition note"> <p class="admonition-title">Note</p> <p>This module requires webob to be installed. To depend on it, you may list routes[middleware] in your <code class="docutils literal notranslate"><span class="pre">requirements.txt</span></code></p> </div> <p>Create a Route middleware object</p> <p>Using the use_method_override keyword will require Paste to be installed, and your application should use Paste’s WSGIRequest object as it will properly handle POST issues with wsgi.input should Routes check it.</p> <p>If path_info is True, then should a route var contain path_info, the SCRIPT_NAME and PATH_INFO will be altered accordingly. This should be used with routes like:</p> <div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="nb">map</span><span class="o">.</span><span class="n">connect</span><span class="p">(</span><span class="s1">'blog/*path_info'</span><span class="p">,</span> <span class="n">controller</span><span class="o">=</span><span class="s1">'blog'</span><span class="p">,</span> <span class="n">path_info</span><span class="o">=</span><span class="s1">''</span><span class="p">)</span> </pre></div> </div> </dd></dl> <dl class="py function"> <dt class="sig sig-object py" id="routes.middleware.is_form_post"> <span class="sig-prename descclassname"><span class="pre">routes.middleware.</span></span><span class="sig-name descname"><span class="pre">is_form_post</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">environ</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#routes.middleware.is_form_post" title="Permalink to this definition">¶</a></dt> <dd><p>Determine whether the request is a POSTed html form</p> </dd></dl> </section> </section> <div class="clearer"></div> </div> </div> </div> <div class="sphinxsidebar" role="navigation" aria-label="main navigation"> <div class="sphinxsidebarwrapper"> <h3><a href="../index.html">Table of Contents</a></h3> <ul> <li><a class="reference internal" href="#"><code class="xref py py-mod docutils literal notranslate"><span class="pre">routes.middleware</span></code> – Routes WSGI Middleware</a><ul> <li><a class="reference internal" href="#module-contents">Module Contents</a></li> </ul> </li> </ul> <h4>Previous topic</h4> <p class="topless"><a href="route.html" title="previous chapter"><code class="xref py py-mod docutils literal notranslate"><span class="pre">routes.route</span></code> – Route</a></p> <h4>Next topic</h4> <p class="topless"><a href="util.html" title="next chapter"><code class="xref py py-mod docutils literal notranslate"><span class="pre">routes.util</span></code> – URL Generator and utility functions</a></p> <div role="note" aria-label="source link"> <h3>This Page</h3> <ul class="this-page-menu"> <li><a href="../_sources/modules/middleware.rst.txt" rel="nofollow">Show Source</a></li> </ul> </div> <div id="searchbox" style="display: none" role="search"> <h3 id="searchlabel">Quick search</h3> <div class="searchformwrapper"> <form class="search" action="../search.html" method="get"> <input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/> <input type="submit" value="Go" /> </form> </div> </div> <script>$('#searchbox').show(0);</script> </div> </div> <div class="clearer"></div> </div> <div class="related" role="navigation" aria-label="related navigation"> <h3>Navigation</h3> <ul> <li class="right" style="margin-right: 10px"> <a href="../genindex.html" title="General Index" >index</a></li> <li class="right" > <a href="../py-modindex.html" title="Python Module Index" >modules</a> |</li> <li class="right" > <a href="util.html" title="routes.util – URL Generator and utility functions" >next</a> |</li> <li class="right" > <a href="route.html" title="routes.route – Route" >previous</a> |</li> <li class="nav-item nav-item-0"><a href="../index.html">Routes 2.5.0 documentation</a> »</li> <li class="nav-item nav-item-1"><a href="index.html" >Routes Modules</a> »</li> <li class="nav-item nav-item-this"><a href=""><code class="xref py py-mod docutils literal notranslate"><span class="pre">routes.middleware</span></code> – Routes WSGI Middleware</a></li> </ul> </div> <div class="footer" role="contentinfo"> © Copyright 2005-2022, Ben Bangert, Mike Orr, and numerous contributers. Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 4.3.2. </div> </body> </html>