-- 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.2.tar.gz
(9.6 kB
view details)
File details
Details for the file anywsgi-0.0.2.tar.gz.
File metadata
- Download URL: anywsgi-0.0.2.tar.gz
- Upload date:
- Size: 9.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.12.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fa4563ccf066e0990d884a026520950c079b07e313eacf35dff865cd485ff34d
|
|
| MD5 |
0cb6b6de9b2896c6bb5c1a16fa70ca92
|
|
| BLAKE2b-256 |
3576a0741e153a922cf6e572862f52cba7adb7aead21e4429bc088da902894f8
|