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-2.0.0.tar.gz
(5.4 kB
view hashes)
Built Distributions
ServeLight-2.0.0-py3.7.egg
(10.5 kB
view hashes)
ServeLight-2.0.0-py2.7.egg
(10.5 kB
view hashes)
Close
Hashes for ServeLight-2.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 94982edeb0b355675f17ebca3c5e21a495df4bf30b4193d358e9fa8129ce420b |
|
MD5 | 402c1e7b0707b939d6e1ef82383393ea |
|
BLAKE2b-256 | d384e1dda2220b1b165b1da5690ee086b5b37a429e4eacaf68b72f7c8f2b7e98 |
Close
Hashes for ServeLight-2.0.0-py2-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 872c183629135388afcd7e9710e91ece0eb0875c3c6ae95fcdbc1e1cf6053d49 |
|
MD5 | cd633990a702adc8a45b8c479d132475 |
|
BLAKE2b-256 | d6c7c0cefa67a75eacb1330d52b0d3fa2c27bd3cea5586aa66cdf8b2542319d1 |