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 example 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-1.0.1.tar.gz
(5.0 kB
view hashes)
Built Distributions
ServeLight-1.0.1-py3.7.egg
(9.6 kB
view hashes)
ServeLight-1.0.1-py2.7.egg
(9.6 kB
view hashes)
Close
Hashes for ServeLight-1.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 802e61ee7b676c20b2b3a3bb6fd9cbe3b3cad17adddd08020e153bce3c89916d |
|
MD5 | 259a7576dc2c3a5e0a13d8113538223e |
|
BLAKE2b-256 | c24fdcb3b708bc9bc7c8d198a744384348db6534b9c1eb8de4457ce50ad51362 |
Close
Hashes for ServeLight-1.0.1-py2-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2d4b1b56998c163d46258d6fb4b728bdb010d4d5012f7d36d824c80dff76471e |
|
MD5 | eab2041b85d192bd4fdff9b66ced7d6e |
|
BLAKE2b-256 | c5a44c7c921655e69fc0e20885dec5fb8853c1e21468f48a67babac6d9906fab |