pyuwsgi

2.0.30.post1 · active · verified Sun Apr 12

pyuwsgi is the official Python package providing the uWSGI server, a fast, self-healing, and developer-friendly application server for web applications. It serves as a glue layer between Python web applications (WSGI) and various protocols like HTTP, SCGI, and FastCGI. The current stable version is 2.0.30.post1, and it generally follows the release cadence of the underlying uWSGI C core.

Warnings

Install

Imports

Quickstart

This quickstart demonstrates how to create a simple WSGI application and run it using the `uwsgi` executable provided by the `pyuwsgi` package. The server listens on HTTP port 8000 and serves the 'application' callable from `app.py`.

import os

def application(environ, start_response):
    # A minimal WSGI application
    status = '200 OK'
    headers = [('Content-type', 'text/plain')]
    start_response(status, headers)
    return [b"Hello from uWSGI!"]

# To run this, save it as `app.py` and then run:
# uwsgi --http :8000 --wsgi-file app.py --callable application
# Or, if `uwsgi` executable isn't in your PATH:
# python -m uwsgi --http :8000 --wsgi-file app.py --callable application

view raw JSON →