An easy-to-use python web framework. Inspired by Flask.
Project description
outside
What's this?
An easy-to-use python web framework. Inspired by Flask.
Requirements
None! The module relies entirely on pre-installed modules.
Demo
The software is actively being used at billplayz.de
Quickstart
This simple script responds with "Hello World!" to every request.
import outside
http_server = outside.OutsideHTTP(("127.0.0.1",80))
def test(request):
return outside.protocol_http.Response(
request = request,
status_code = 200,
headers = {},
content = "Hello World!"
)
http_server.set_route("/",test)
if (__name__ == "__main__"):
http_server.run()
Reference
outside.OutsideHTTP.config
host: (address: string ["0.0.0.0"], port: int [80]) backlog_length: length: int [25] process_timeout: seconds: int [60] termination_timeout: seconds: int [5] recv_size: bytes: int [1024] send_size: bytes: int [1024] accept_timeout: seconds: int [0.02] ssl_enabled: enabled: bool [False] ssl_keyfile: path: string [""] ssl_certfile: path: string [""] max_body_size_mb: megabytes: int [250] keep_alive: enabled: bool [True] post_callback: callback: function or None [None] pre_send: callback: function or None [None]
outside.OutsideHTTP.set_route()
Syntax: outside.OutsideHTTP.set_route(startswith: string,callback: function)
Example: http_server.set_route("/testroute/",my_function)
outside.OutsideHTTP.remove_route()
Syntax: outside.OutsideHTTP.remove_route(startswith: string)
Example: http_server.remove_route("/testroute/")
outside.OutsideHTTP.set_errorhandler()
Syntax: outside.OutsideHTTP.set_errorhandler(errorcode: int, handler: function)
Example: http_server.set_errorhandler(404,my_function)
outside.OutsideHTTP.remove_errorhandler()
Syntax: outside.OutsideHTTP.remove_errorhandler(errorcode: int)
Example: http_server.remove_errorhandler(404)
outside.OutsideHTTP.terminate()
Syntax: outside.OutsideHTTP.terminate()
Example: http_server.terminate()
outside.OutsideHTTP.run()
Syntax: outside.OutsideHTTP.run()
Example: http_server.run()
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 Distribution
Hashes for outside_framework-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | adc585a4c7d5c4cacc10e1c8b03e25c1b62267974f8d24fec681870d621ed770 |
|
MD5 | d90dd8fdc55cdefc4b0580ea66bb5ef6 |
|
BLAKE2b-256 | 134622a355da34184f6e0a318597aa7282f1b19c5626e39cf0eb9f194e248730 |