又一个wsgi服务器实现。
kwsgi的Python项目详细描述
又一个wsgi服务器实现。
用法
用法如下:
$ kwsgi hello.py app --reload
选项如下:
$ kwsgi --help Usage: kwsgi [OPTIONS] FILEPATH WSGIAPP Example: kwsgi hello.py app -p 5000 --reload Options: -h, --host TEXT The interface to bind to. -p, --port INTEGER The port to bind to. --reload / --no-reload Enable live reloading --daemonize / --no-daemonize Detaches the server from the controlling terminal and enters the background. --interval INTEGER Interval time to check file changed for reloading --validate / --no-validate Validating your WSGI application complying with PEP3333 compliance. --help Show this message and exit.
您可以从python脚本中与kwsgi集成:
fromkwsgiimportWSGIServerdefapplication(env,start_response):start_response('200 OK',[('Content-type','text/plain; charset=utf-8')])return[b'Hello World']if__name__=='__main__':server=WSGIServer(application)server.run_forever()
发展路线图
这些是当前计划的主要里程碑:
- [完成]添加最小实现(至少可以运行django应用程序)。
- 使用c-extensions、mypyc或rust优化一些重要的性能瓶颈。
- 添加绿色线程实现。