wsgiserver

raw JSON →
1.3 verified Fri May 01 auth: no python maintenance

A high-speed, production ready, thread pooled, generic WSGI server with SSL support. Version 1.3 is the latest release. The project appears to be in maintenance mode with no recent updates.

pip install wsgiserver
error ImportError: No module named wsgiserver
cause The package is not installed or the environment does not have it.
fix
Run 'pip install wsgiserver' to install the library.
error TypeError: 'int' object is not iterable
cause The application's return value is not a list of bytes; older WSGI spec requires iterable.
fix
Ensure your WSGI app returns a list of bytes, e.g., return [b'Hello'].
gotcha The package name on PyPI is 'wsgiserver' but the import uses 'wsgiserver' as well, so no confusion. However, the project is not actively maintained; consider using gunicorn or uWSGI for new projects.
fix Use a more modern WSGI server like gunicorn or uWSGI.
deprecated This library uses Python 2 style threading and may not be fully compatible with Python 3. Version 1.3 was released for Python 2.7.
fix Ensure you are running on Python 2.7 or test thoroughly on Python 3.

Create a minimal WSGI server to serve a simple application.

from wsgiserver import WSGIServer

def my_app(environ, start_response):
    start_response('200 OK', [('Content-Type', 'text/plain')])
    return [b'Hello, World!']

server = WSGIServer(my_app, host='0.0.0.0', port=8080)
server.start()