Short introduction to uWSGI server and architecture
The uWSGI project aims at developing a full stack for building hosting services. Application servers (for various programming languages and protocols), proxies, process managers, and monitors are all implemented using a common API and a common configuration style. Thanks to its pluggable architecture it can be extended to support more platforms and languages.
Request plugins (implement application server interfaces for various languages and platforms: WSGI, PSGI, Rack, Lua WSAPI, CGI, PHP, Go ā¦)
Gateways (implement load balancers, proxies and routers)
Quickstart for Python
This quickstart will show you how to deploy simple WSGI applications and common web frameworks. In order to start using uWSGI we need the build-essential python-dev tooling.
Install on Debian-based distro
$apt-getinstallbuild-essentialpython-dev
Install on CentOS distro
$yuminstallbuild-essentialpython-dev
Install uWSGI
Before installing uWSGI module, make sure the workstation has the Python development installed.
uWSGI Via PIP
Using the network installer
Simple uWSGI app
Letās start with a simple āHello Worldā example:
Let's save this minimal app as hitme.py
As you can see, it is composed of a single Python function. It is called āapplicationā as this is the default function that the uWSGI Python loader will search for.
Deploy it on HTTP port 9090
In case we need monitoring, the stats subsystem allows you to export uWSGIās internal statistics as JSON:
By visiting port 9090 in the browser, we should see Hello World message served by uWSGI.