Skip to content
Myr

Reorder deployment options.

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Ron DuPlain · committed by Ron DuPlain · parent 7e4b705 · Browse files · 4 files+40 added−39 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

4 files+40 added−39 removed

  • other:+40 added−39 removed

4 files+40 added−39 removed

modified:docs/deploying/fastcgi.rst+5 added-6 removed
1 unmodified line
23FastCGI4=======56FastCGI is a deployment option on servers like `nginx`_, `lighttpd`_,7and `cherokee`_; see :ref:`deploying-uwsgi` and8:ref:`deploying-other-servers` for other options. To use your WSGI9application with any of them you will need a FastCGI server first. The10most popular one is `flup`_ which we will use for this guide. Make sure11to have it installed to follow along.6FastCGI is a deployment option on servers like `nginx`_, `lighttpd`_, and7`cherokee`_; see :ref:`deploying-uwsgi` and :ref:`deploying-wsgi-standalone`8for other options. To use your WSGI application with any of them you will need9a FastCGI server first. The most popular one is `flup`_ which we will use for10this guide. Make sure to have it installed to follow along.1112.. admonition:: Watch Out1314 Please make sure in advance that any ``app.run()`` calls you might
149 unmodified lines
modified:docs/deploying/index.rst+3 added-3 removed
18 unmodified lines
19.. toctree::20 :maxdepth: 22122 mod_wsgi23 cgi24 fastcgi23 wsgi-standalone24 uwsgi26 others25 fastcgi26 cgi
modified:docs/deploying/uwsgi.rst+4 added-5 removed
2 unmodified lines
3uWSGI4=====56uWSGI is a deployment option on servers like `nginx`_, `lighttpd`_, and7`cherokee`_; see :ref:`deploying-fastcgi` and8:ref:`deploying-other-servers` for other options. To use your WSGI9application with uWSGI protocol you will need a uWSGI server10first. uWSGI is both a protocol and an application server; the11application server can serve uWSGI, FastCGI, and HTTP protocols.7`cherokee`_; see :ref:`deploying-fastcgi` and :ref:`deploying-wsgi-standalone`8for other options. To use your WSGI application with uWSGI protocol you will9need a uWSGI server first. uWSGI is both a protocol and an application server;10the application server can serve uWSGI, FastCGI, and HTTP protocols.1112The most popular uWSGI server is `uwsgi`_, which we will use for this13guide. Make sure to have it installed to follow along.14
53 unmodified lines
modified:docs/deploying/wsgi-standalone.rst+28 added-25 removed
1.. _deploying-other-servers:1.. _deploying-wsgi-standalone:23Other Servers4=============3Standalone WSGI Containers4==========================56There are popular servers written in Python that allow the execution of WSGI7applications as well. These servers stand alone when they run; you can proxy8to them from your web server.6There are popular servers written in Python that contain WSGI applications and7serve HTTP. These servers stand alone when they run; you can proxy to them8from your web server. Note the section on :ref:`deploying-proxy-setups` if you9run into issues.1011Gunicorn12--------1314`Gunicorn`_ 'Green Unicorn' is a WSGI HTTP Server for UNIX. It's a pre-fork15worker model ported from Ruby's Unicorn project. It supports both `eventlet`_16and `greenlet`_. Running a Flask application on this server is quite simple::1718 gunicorn myproject:app1920`Gunicorn`_ provides many command-line options -- see ``gunicorn -h``.21For example, to run a Flask application with 4 worker processes (``-w224``) binding to localhost port 4000 (``-b 127.0.0.1:4000``)::2324 gunicorn -w 4 -b 127.0.0.1:4000 myproject:app2526.. _Gunicorn: http://gunicorn.org/27.. _eventlet: http://eventlet.net/28.. _greenlet: http://codespeak.net/py/0.9.2/greenlet.html2930Tornado31--------3233`Tornado`_ is an open source version of the scalable, non-blocking web34server and tools that power `FriendFeed`_. Because it is non-blocking and35uses epoll, it can handle thousands of simultaneous standing connections,36which means it is ideal for real-time web services. Integrating this17service with Flask is a trivial task::37service with Flask is straightforward::3839 from tornado.wsgi import WSGIContainer40 from tornado.httpserver import HTTPServer41 from tornado.ioloop import IOLoop
23 unmodified lines
65.. _Gevent: http://www.gevent.org/66.. _greenlet: http://codespeak.net/py/0.9.2/greenlet.html67.. _libevent: http://monkey.org/~provos/libevent/6849Gunicorn50--------69.. _deploying-proxy-setups:7052`Gunicorn`_ 'Green Unicorn' is a WSGI HTTP Server for UNIX. It's a pre-fork53worker model ported from Ruby's Unicorn project. It supports both `eventlet`_54and `greenlet`_. Running a Flask application on this server is quite simple::5556 gunicorn myproject:app5758`Gunicorn`_ provides many command-line options -- see ``gunicorn -h``.59For example, to run a Flask application with 4 worker processes (``-w604``) binding to localhost port 4000 (``-b 127.0.0.1:4000``)::6162 gunicorn -w 4 -b 127.0.0.1:4000 myproject:app6364.. _Gunicorn: http://gunicorn.org/65.. _eventlet: http://eventlet.net/66.. _greenlet: http://codespeak.net/py/0.9.2/greenlet.html6771Proxy Setups72------------7374If you deploy your application using one of these servers behind an HTTP
31 unmodified lines