<metaname="description" content="A Web Server Gateway Interface (WSGI) server runs Python code to create a web application. Learn more about WSGI servers on Full Stack Python.">
<divstyle="padding: 0 0 20px 0; margin: 0 0 20px 0; background-color: #22B24C;">
<divclass="container">
<pclass="banner"><ahref="https://www.gumroad.com/l/python-deployments" style="color: #fff">Learning web development? Check out The Full Stack Python Guide to Deployments book</a>!</p>
</div>
</div><ahref="https://github.com/makaimc/fullstackpython.com"><imgstyle="position: absolute; top: 0; right: 0; border: 0;" src="/img/fork.png" alt="Fork me on GitHub"></a>
<p>This <ahref="http://agiliq.com/blog/2013/07/basics-wsgi/">basics of WSGI</a> post
contains a simple example of how a WSGI-compatible application works.</p>
</li>
<li>
<p><ahref="https://www.digitalocean.com/community/tutorials/a-comparison-of-web-servers-for-python-based-web-applications">A comparison of web servers for Python web apps</a>
is a good read to understand basic information about various WSGI server
implementations.</p>
</li>
<li>
<p>A thorough and informative post for LAMP-stack hosting choices is
presented in the
"<ahref="http://www.apreche.net/complete-single-server-django-stack-tutorial/">complete single server Django stack tutorial</a>." </p>
</li>
<li>
<p>The Python community made a long effort to
<ahref="http://blog.dscpl.com.au/2010/05/modpython-project-soon-to-be-officially.html">transition from mod_python</a>
to the WSGI standard. That transition period is now complete and an
implementation of WSGI should always be used instead mod_python.</p>
</li>
<li>
<p>Nicholas Piël wrote an interesting benchmark blog post of
Note that the post is a few years old. Benchmarks should be considered
for their specific tested scenarios and not quickly extrapolated as general
"this server is faster than this other server" results.</p>
</li>
<li>
<p><ahref="https://www.digitalocean.com/community/articles/how-to-deploy-python-wsgi-applications-using-a-cherrypy-web-server-behind-nginx">How to Deploy Python WSGI Applications with CherryPy</a>
answers why CherryPy is a simple combination web and WSGI server along with
how to use it.</p>
</li>
<li>
<p>Another Digital Ocean walkthrough goes into
<ahref="https://www.digitalocean.com/community/tutorials/how-to-deploy-python-wsgi-apps-using-gunicorn-http-server-behind-nginx">How to Deploy Python WSGI Apps Using Gunicorn HTTP Server Behind Nginx</a>.</p>
</li>
<li>
<p><ahref="https://lincolnloop.com/blog/uwsgi-swiss-army-knife/">The uWSGI Swiss Army Knife</a>
shows how uWSGI can potentially be used for more than just running the
Python web application - it can also serve static files and handle
caching in a deployment.</p>
</li>
</ul>
<h2>WSGI servers learning checklist</h2>
<ol>
<li>
<p>Understand that WSGI is a standard Python specification for applications
and servers to implement. </p>
</li>
<li>
<p>Pick a WSGI server based on available documentation and tutorials. Green
Unicorn is a good one to start with since it's been around for awhile.</p>
</li>
<li>
<p>Add the WSGI server to your server deployment.</p>
</li>
<li>
<p>Configure the web server to pass requests to the WSGI server for
appropriate URL patterns.</p>
</li>
<li>
<p>Test that the WSGI server responds to local requests but not direct
requests outside your infrastructure. The web server should be the pass
through for requests to and responses from the WSGI server.</p>
</li>
</ol>
<h3>What's next after your Python app is running?</h3>
<ahref="http://www.deploypython.com/"><imgsrc="/img/sponsored/fsp-deployment-guide.png" alt="The Full Stack Python Guide to Deployments" width="100%"></a>
<pstyle="font-size: .8em; margin-top: 10px;">Searching for a complete, step-by-step deployment walkthrough? Learn more about <ahref="http://www.deploypython.com/">The Full Stack Python Guide to Deployments book</a>.