What IS uWsgi
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.
uWSGI - official documentation
uWSGI Components
The Core (implements configuration, processes management, sockets creation, monitoring, logging, shared memory areas, ipc, cluster membership)
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
Install on CentOS distro
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.
uWSGI Resources
uWSGI - the official website
Last updated
Was this helpful?