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()
$ curl localhost:8000/static/style.css
.foo {
font-size: 10px;
}
LICENSE
MIT License
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 Distributions
Close
Hashes for wsgi-static-middleware-0.0.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | def5741b1303d2abd8ce3c55050c90e2c39ba674b2b90c2ef8469d9f59a58e95 |
|
MD5 | 946524634dc70b10160f3b6eff88ed6e |
|
BLAKE2b-256 | 917e8692f66320a5d4365573ea645fd5e8e75a3d576617455605a6286c19aff9 |
Close
Hashes for wsgi_static_middleware-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 888067429af265a6bae72f7f1a1a60acd345fc88dc1858fb2fe44f3f936b6333 |
|
MD5 | 4d709fdb8100527ffeed39581305f074 |
|
BLAKE2b-256 | 65f9325bf40193d8b8956bdcbf443bc40ae98fcdba5f678630f6bd519af4d892 |
Close
Hashes for wsgi_static_middleware-0.0.2-py2-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c7bc3d0c60157687fc33639e811fdb8d82a27a04ec731c010f4b4b6787c392a8 |
|
MD5 | 5008510d007135eabb33a76c0de4b5b9 |
|
BLAKE2b-256 | 7eb611e802cf6fc04f6a71e0919726d431c5c6e73c4544264224ccc115dd9d9d |