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: .. code-block:: python 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"
.. code-block:: python 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) .. code-block:: bash 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
Built Distributions
Hashes for ServeLight-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 244699cafc2e90562e8cf6f638d1fd838fcdba8b57d61fbd319d455c497519e3 |
|
MD5 | 72b88a4305869d8250cec4b90d726295 |
|
BLAKE2b-256 | 75607221bc99f5ba362687355002db1dc5d5857b9c5334c90c441d91ad1db7a0 |
Hashes for ServeLight-1.0.0-py2-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 124a86cd7c686ed14a2cdf72ead67850b6abee1da7b621d8972f77d0711e945d |
|
MD5 | 61b3add6c866daae4c755e383275bcaa |
|
BLAKE2b-256 | 38f984abe5372245c9646396cebb0f34a4cec5561609b62c73b7e693d5fadba7 |