Registry / web-framework / uwsgi
library2.0.31pypypiunverified

uWSGI is an open-source, fast, and self-healing application server container that serves as a full stack for building hosting services. It is primarily known for efficiently running Python WSGI applications but supports various other languages and protocols (like Ruby/Rack, Perl/PSGI, PHP, Go) through its pluggable architecture. The current stable version is 2.0.31. The project has been in maintenance mode since October 2022, focusing on stability rather than new features.

pip install uwsgi
INSTALL
IMPORT
SIG · UWSGI
U
uwsgi
web-frameworkpythonv2.0.31
Install
Import
Disk
Pass rate
0/ 10
Env Coverage0 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v? · pip install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
build_error
glibc
py 3.103.95 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

uwsgidecorators
import uwsgidecorators
import uwsgidecorators

This quickstart demonstrates how to create a basic WSGI 'Hello World' application and run it using the `uwsgi` command-line tool. The `--http` option binds to an HTTP port, `--wsgi-file` specifies your application file, `--callable` points to the WSGI callable, and `--processes`/`--threads` configure concurrency.

import os def application(environ, start_response): status = '200 OK' headers = [('Content-type', 'text/plain')] start_response(status, headers) return [b"Hello from uWSGI and Python!"] # To run: save this as `wsgi_app.py` # Then execute from your terminal: # uwsgi --http :9090 --wsgi-file wsgi_app.py --callable application --processes 1 --threads 1
uwsgi --version
Debug
Known issues
gotchaInstalling `uwsgi` via `pip` often fails without system-level build tools (C compiler, Python development headers). This is because uWSGI is a C application that gets compiled during installation.
fix
Ensure `build-essential` (Debian/Ubuntu) or `Development Tools` (Fedora/RHEL) and `python-dev`/`python-devel` are installed on your system. Alternatively, consider using `pyuwsgi` which provides pre-built wheels and includes common libraries.
affects: All versions
gotchaPython threads are disabled by default within uWSGI's Python plugin. Application-generated threads will not run unless explicitly enabled.
fix
Enable Python threads by adding `--enable-threads` (command line) or `enable-threads = true` (configuration file) to your uWSGI configuration. Running in multithreading mode (with `threads` option) automatically enables it.
affects: All versions
breakingNever expose a socket speaking the native `uwsgi` protocol directly to the public network, as it allows dynamic loading of applications (arbitrary code execution).
fix
Always place a reverse proxy (like Nginx or Apache) in front of uWSGI instances to sanitize/validate requests and proxy them using the `uwsgi` protocol.
affects: All versions
gotchaIf an HTTP request contains a body (e.g., POST request from a form), your application *must* read (consume) the entire body. Failure to do so can 'clobber' the communication socket with the web server, leading to hung connections or errors.
fix
Ensure your WSGI application or framework fully reads the request `wsgi.input` stream when a request body is expected.
affects: All versions
gotchaWhen using UNIX sockets, they are filesystem objects subject to standard UNIX permissions. If your web server lacks write access, it cannot communicate with uWSGI.
fix
Set appropriate permissions for the UNIX socket using the `--chmod-socket` option (e.g., `--chmod-socket=666` or specific user/group permissions) so your web server can access it.
affects: All versions
gotchaReceiving 'invalid request block size' errors in logs often indicates that the default internal buffer size (4096 bytes) for request headers is too small.
fix
Increase the buffer size with the `--buffer-size` option (e.g., `--buffer-size 8192`) up to 65535 bytes, based on your application's needs.
affects: All versions
gotchaRunning uWSGI instances directly as the `root` user is a security risk.
fix
Start uWSGI as `root` if necessary for binding to privileged ports, but immediately drop privileges to a non-root user and group using the `uid` and `gid` options.
affects: All versions
Upgrade
Version history
2.0.31latest on PyPI · released Oct 11, 2025
Audit
Dependencies
C compiler (e.g., gcc, clang)requireduWSGI is primarily a C application and often compiles from source during `pip install`.
Python development headers (e.g., python-dev, python-devel)requiredRequired for building uWSGI with Python support.
Agent activity
17 hits · last 30 days
node
14
Resources