<h1>Waitress<aclass="headerlink"href="#waitress"title="Link to this heading">¶</a></h1>
<p><aclass="reference external"href="https://docs.pylonsproject.org/projects/waitress/">Waitress</a> is a pure Python WSGI server.</p>
<ulclass="simple">
<li><p>It is easy to configure.</p></li>
<li><p>It supports Windows directly.</p></li>
<li><p>It is easy to install as it does not require additional dependencies
or compilation.</p></li>
<li><p>It does not support streaming requests, full request data is always
buffered.</p></li>
<li><p>It uses a single process with multiple thread workers.</p></li>
</ul>
<p>This page outlines the basics of running Waitress. Be sure to read its
documentation and <codeclass="docutils literal notranslate"><spanclass="pre">waitress-serve</span><spanclass="pre">--help</span></code> to understand what features
are available.</p>
<sectionid="installing">
<h2>Installing<aclass="headerlink"href="#installing"title="Link to this heading">¶</a></h2>
<p>Create a virtualenv, install your application, then install
<h2>Running<aclass="headerlink"href="#running"title="Link to this heading">¶</a></h2>
<p>The only required argument to <codeclass="docutils literal notranslate"><spanclass="pre">waitress-serve</span></code> tells it how to load
your Flask application. The syntax is <codeclass="docutils literal notranslate"><spanclass="pre">{module}:{app}</span></code>. <codeclass="docutils literal notranslate"><spanclass="pre">module</span></code> is
the dotted import name to the module with your application. <codeclass="docutils literal notranslate"><spanclass="pre">app</span></code> is
the variable with the application. If you’re using the app factory
pattern, use <codeclass="docutils literal notranslate"><spanclass="pre">--call</span><spanclass="pre">{module}:{factory}</span></code> instead.</p>
<divclass="highlight-text notranslate"><divclass="highlight"><pre><span></span># equivalent to 'from hello import app'
$ waitress-serve --host 127.0.0.1 hello:app
# equivalent to 'from hello import create_app; create_app()'
<p>The <codeclass="docutils literal notranslate"><spanclass="pre">--host</span></code> option binds the server to local <codeclass="docutils literal notranslate"><spanclass="pre">127.0.0.1</span></code> only.</p>
<p>Logs for each request aren’t shown, only errors are shown. Logging can
be configured through the Python interface instead of the command line.</p>
</section>
<sectionid="binding-externally">
<h2>Binding Externally<aclass="headerlink"href="#binding-externally"title="Link to this heading">¶</a></h2>
<p>Waitress should not be run as root because it would cause your
application code to run as root, which is not secure. However, this
means it will not be possible to bind to port 80 or 443. Instead, a
reverse proxy such as <aclass="reference internal"href="nginx.html"><spanclass="doc">nginx</span></a> or <aclass="reference internal"href="apache-httpd.html"><spanclass="doc">Apache httpd</span></a> should be used
in front of Waitress.</p>
<p>You can bind to all external IPs on a non-privileged port by not
specifying the <codeclass="docutils literal notranslate"><spanclass="pre">--host</span></code> option. Don’t do this when using a reverse
proxy setup, otherwise it will be possible to bypass the proxy.</p>
<p><codeclass="docutils literal notranslate"><spanclass="pre">0.0.0.0</span></code> is not a valid address to navigate to, you’d use a specific