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