Lightweight and Responsive Server Framework
Project description
ServeLight
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.3.2.tar.gz
(20.3 kB
view hashes)
Built Distributions
ServeLight-3.3.2-py3.7.egg
(46.7 kB
view hashes)
ServeLight-3.3.2-py3-none-any.whl
(23.1 kB
view hashes)
ServeLight-3.3.2-py2.7.egg
(46.6 kB
view hashes)
ServeLight-3.3.2-py2-none-any.whl
(23.1 kB
view hashes)
Close
Hashes for ServeLight-3.3.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b74c5d03b134ca06cbe34c9b287321a47ed998bccd880896f2ebf4e9e67e9eb2 |
|
MD5 | b79413a95f28a782eec8a7c86f9073ed |
|
BLAKE2b-256 | 5a4b970ac49b7be1ef4ce7dbeea963a47f6e9126d2f4f748c2c934e1555f232b |
Close
Hashes for ServeLight-3.3.2-py2-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f65682baa6dd43cfdc67db9aa9b6b9095e62b6b848bf63dbd7d710a35a868985 |
|
MD5 | d29599c1e8574601c527b96ad2c1c7b2 |
|
BLAKE2b-256 | 4f9aa4c7d713ba3c3ffd94a9c429dce6287dd248b57f062d88f5f1bf19138042 |