Deploying the Python Web using Gunicorn

Source: Internet
Author: User

Gunicorn is a WSGI-enabled Web server that supports Gevent

Install Setuptools first. wget https://bootstrap.pypa.io/ez_setup.py

$python ez_setup.py

$easy _install Pip

$pip Install Gevent

$pip Install Gunicorn

$apt-get Install Libmysqld-dev

$pip Install Mysql-python

After the installation is complete, you can either directly execute the Gunicorn code:application code file that you have. Application is Wsgifunc 8000 port is used by default

such as flask:

core.py

1  from Import Flask 2 app = Flask (__name__)34 @app. Route ('/'  )5def  Hello_world ():6     return'  Hello world! '

Operating method: Gunicorn Core:app

Browser Access localhost:8000

Available parameters:

Gunicorn-b 127.0.0.1:8080 Core:app bound port

GUNICORN-W 8 Core:app Open Multi-process.

Gunicorn-k gevent Core:app using gevent mode

Once completed, a robust server can be built with Nginx Supervisor (Process management tool).

Deploying the Python Web using Gunicorn

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.