Lightweight and Responsive Server Framework
Project description
ServerLight
This module defines classes for implementing HTTP/WSGI servers (Web servers).
Warning : This is not recommended for production. It only implements basic security checks.
One class, Server or WSGI Server creates and listens at the HTTP socket, dispatching the requests to a handler. Code to create and run the server looks like this:\
def run(server_class=Server, handler_class=BaseHandler):
server_address = ('', 8000)
httpd = server_class(server_address, handler_class)
httpd.serve_forever()
run()
- fast ( It's very fast )
- simple ( around 150 lines )
- lightweight (simple and lightweight )
- WSGI ( supports web server gateway interface )
- micro web-server ( can use as a traditional server )
- with web frameworks (any WSGI framework supported)
Flask, Django, Pyramid, Bottle supported
Example: "Hello World"
def app(environ, start_response):
""A barebones WSGI application.
This is a starting point for your own Web framework :)
"""
status = '200 OK'
response_headers = [('Content-Type', 'text/plain')]
start_response(status, response_headers)
return [b'Hello world from a simple WSGI application!\n']
save above code as app.py now run sl (ServeLight)
python -m sl --app=app:app
view examples for more... View Documentaion*
License
Code and documentation are available according to the MIT License (see 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
ServeLight-3.0.1.tar.gz
(20.1 kB
view hashes)
Built Distributions
ServeLight-3.0.1-py3.7.egg
(46.1 kB
view hashes)
ServeLight-3.0.1-py3-none-any.whl
(22.8 kB
view hashes)
ServeLight-3.0.1-py2.7.egg
(46.0 kB
view hashes)
ServeLight-3.0.1-py2-none-any.whl
(22.8 kB
view hashes)
Close
Hashes for ServeLight-3.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bfbbca52d49774226aa689cb593e84920288ecf3ad819af8f0df512a07d7a6b1 |
|
MD5 | 3e698b88ce2f361cec1efe0b4346cd2e |
|
BLAKE2b-256 | 4b96ec91dc4ec5171cabf0a022c3d4d5de113e327bb4a5e23cfb5576d81d3b9c |
Close
Hashes for ServeLight-3.0.1-py2-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0e5d460e84e4d4a2cd418c6f4d6a8ef9291cedb16e11390b5dc0382b1c01eda3 |
|
MD5 | d5b6a03c18a77bdd7edeb631d6d20926 |
|
BLAKE2b-256 | 93fca80184bdc4336ab3ba9fb704d688102afa691e366cb71b61dd088e9a8e38 |