Skip to main content

WSGI server written in Rust.

Project description

Pyruvate WSGI server

Pyruvate is a WSGI server written in Rust. It’s not yet ready for production so use with caution.


Development Installation

  • Install Rust

  • Install and activate Rust nightly (needed by PyO3)

  • Install and activate a Python 3 (> 3.5) virtualenv

  • Install setuptools_rust using pip:

    $ pip install setuptools_rust

  • Install pyruvate, e.g. using pip:

    $ pip install -e git+[test]

Using Pyruvate in your WSGI application

From Python

A hello world WSGI application using pyruvate listening on and using 2 worker threads looks like this:

import pyruvate

def application(environ, start_response):
    """Simplest possible application object"""
    status = '200 OK'
    response_headers = [('Content-type', 'text/plain')]
    start_response(status, response_headers, None)
    return [b"Hello world!\n"]

pyruvate.serve(application, "", 2)

Using PasteDeploy

Again listening on and using 2 worker threads:

use = egg:pyruvate#main
socket =
workers = 2

Example Configurations

Django 2

After installing Pyruvate in your Django virtualenv, create or modify your file (1 worker listening on

import os
import pyruvate

from django.core.wsgi import get_wsgi_application

os.environ.setdefault("DJANGO_SETTINGS_MODULE", "your_django_application.settings")

application = get_wsgi_application()

pyruvate.serve(application, "", 1)

You can now start Django + Pyruvate with:

$ python

Override settings by using the DJANGO_SETTINGS_MODULE environment variable when appropriate. Tested with Django 2.2.x.


Create or modify (2 workers listening on

from logging.config import fileConfig
import os.path
import pyruvate
fileConfig(r'/path/to/mapproxy/log.ini', {'here': os.path.dirname(__file__)})

from mapproxy.wsgiapp import make_wsgi_app
application = make_wsgi_app(r'/path/to/mapproxy/mapproxy.yml')

pyruvate.serve(application, "", 2)

Start from your virtualenv:

$ python

Tested with Mapproxy 1.12.x.

Plone 5.2

Using zc.buildout and plone.recipe.zope2instance you can define an instance part using Pyruvate’s PasteDeploy <> _entry point:

recipe = plone.recipe.zope2instance
http-address =
eggs =
wsgi-ini-template = ${buildout:directory}/templates/

The server section of the template provided with the wsgi-ini-template option should look like this (3 workers listening on http-address as specified in the buildout [instance] part):

use = egg:pyruvate#main
socket = %(http_address)s
workers = 3

Tested with Plone 5.2.x.

Nginx settings

HTTP connection handling is still work in progress in Pyruvate, therefore you will see issues when using it behind a reverse proxy server. In any case if you want to try it with Nginx you might want to configure HTTP 1.1, e.g.:

location / {
    proxy_pass http://localhost:7878;
    proxy_http_version 1.1;
    proxy_set_header   Connection "";

0.2.0 (2020-03-10)

  • Added some Python tests (using py.test and tox)
  • Improve handling of HTTP headers
  • respect content length header when using sendfile

0.1.0 (2020-02-10)

  • Initial release

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for pyruvate, version 0.2.0
Filename, size File type Python version Upload date Hashes
Filename, size pyruvate-0.2.0-cp36-cp36m-manylinux1_x86_64.whl (2.9 MB) File type Wheel Python version cp36 Upload date Hashes View
Filename, size pyruvate-0.2.0-cp37-cp37m-manylinux1_x86_64.whl (1.5 MB) File type Wheel Python version cp37 Upload date Hashes View
Filename, size pyruvate-0.2.0-cp38-cp38-manylinux1_x86_64.whl (4.4 MB) File type Wheel Python version cp38 Upload date Hashes View
Filename, size pyruvate-0.2.0.tar.gz (24.4 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page