-- coding: utf-8 --
anywsgi-py
quick and dirty use any available WSGI server for running from command line
Getting Started
Regular install
pip install anywsgi
Without a source code checkout
Picking up the latest version
pip uninstall anywsgi; python -m pip install --upgrade git+https://github.com/clach04/anywsgi-py.git
From a source code checkout
# pip uninstall anywsgi
# python -m pip install -r requirements.txt
# TODO requirements_optional.txt
python -m pip install -e .
Hello World Demo
import os
import sys
import anywsgi
from anywsgi import DEFAULT_LISTEN_ADDRESS, DEFAULT_SERVER_PORT
def application(environ, start_response):
start_response('200 OK',[('Content-type','text/html')])
return [b'<html><body>Hello World!</body></html>'] # NOTE Python 3 requires this to be bytes, i.e. an iterator of bytes
print('Python %s on %s' % (sys.version, sys.platform))
listen_address = os.environ.get('LISTEN_ADDRESS', DEFAULT_LISTEN_ADDRESS)
server_port = int(os.environ.get('LISTEN_PORT', DEFAULT_SERVER_PORT))
anywsgi.my_start_server(application, listen_address=listen_address, listen_port=server_port)
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
anywsgi-0.0.3.tar.gz
(9.7 kB
view details)
File details
Details for the file anywsgi-0.0.3.tar.gz.
File metadata
- Download URL: anywsgi-0.0.3.tar.gz
- Upload date:
- Size: 9.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.12.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
65e2a168451429f6e990c908498a592c746282a2ee1aeb194334ecc752bfb81d
|
|
| MD5 |
b51e58bb7bde6c377cd0c2884f6500e6
|
|
| BLAKE2b-256 |
d682932c7c08ec9ee3a9a761336d61636b0337902889c01e5b38b3d43b211b94
|