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*
Report [Issues(https://github.com/Ksengine/ServeLight/issues)*
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
Built Distributions
Hashes for ServeLight-3.4.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 573db0f86506067c0b1d9855d14ec996e0dc6d6ef29ad8d9593388bade830938 |
|
MD5 | 7dcb2317fbbe4002c0823fb7d2e91c31 |
|
BLAKE2b-256 | 88de3020f2a7091fb66eaa1e15e47eb0e20d6d0d1f1d79b7f18da1b890ff07b4 |
Hashes for ServeLight-3.4.4-py2-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ab3f952ad7ca2786ea54d06ace2b822640f2b63fe681f52c18efcddb8a1761dc |
|
MD5 | f14f34a4351c9c13a31a43f48da6cc2a |
|
BLAKE2b-256 | 0549ca1edc6ef20145c0d8d21846ebf4707c584a244fc18adc476b6b2e81f6db |