Basic static file serving middleware for WSGI
Project description
Basic static file serving middleware for WSGI.
Usage
import os
from wsgiref.simple_server import make_server
from wsgi_static_middleware import StaticMiddleware
BASE_DIR = os.path.dirname(__name__)
STATIC_DIRS = [os.path.join(BASE_DIR, 'static')]
def app(env, start_response):
start_response('200 OK', [('Conte-type', 'text/plain; charset=utf-8')])
return [b'Hello World']
app = StaticMiddleware(app, static_root='static', static_dirs=STATIC_DIRS)
if __name__ == '__main__':
httpd = make_server('', 8000, app)
httpd.serve_forever()
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for wsgi-static-middleware-0.0.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | a98735c0bd3bf0553646a6ea3310db757bd8abbf9e1b064dd21840d3c3055e7a |
|
MD5 | 3514860e52d90b412c65b30c7f9fd642 |
|
BLAKE2b-256 | b4492d30cf6d828f81efcca1e1a424ce729339650dc2414d77fafa557219ba2e |
Close
Hashes for wsgi_static_middleware-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ca13802d6e1e7940342dc17be5fffa2d8c34f150adbe678d57c73d60c9093406 |
|
MD5 | be54984f6be8cb57dc6e6cd5ae7edf54 |
|
BLAKE2b-256 | 69ba7a727536f9f3bf97c769202aef10fb0a2bfee8f6ad6a6de12f2f12e785e4 |