wsgi调度员。

matcha的Python项目详细描述


一目了然

matcha是所有wsgi应用程序的调度器 基于环境中路径信息的匹配模式。

让我们将您的wsgi应用程序注册到matchings和 创建wsgi应用程序。

>>>fromwsgiref.simple_serverimportmake_server>>>frommatchaimportMatchingasm,bundle,make_wsgi_app>>>>>>fromyourprojectimporthome_app>>>fromyourproject.blogimportpost_list_app,post_detail_app>>>>>>>>>matching=bundle(...m('/',home_app,'home'),...m('/post/',post_list_app,'post_list'),...m('/post/{post_slug}/',post_detail_app,'post_detail'),...)>>>>>>if__name__=='__main__':...app=make_wsgi_app(matching)......httpd=make_server('',8000,app)...httpd.serve_forever()

现在,从浏览器访问:

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
图形Java仿射变换以旋转通用路径   IntelliJ IDEA中的java代码标记为编译器错误,在Eclipse中可以正常工作   java ArrayList的containsAll返回了错误的值   如何在安卓中的片段活动中添加java代码   java通过使用netbeans调用jbutton,将带有行的jbutton添加到jtable中   java在更新arrayAdapter/listView之前更新最终列表   java如何在另一个项目中导入包含AspectJ方面和注释的项目   为什么我的java布尔测试总是失败?   Eclipse中的java自动激活   在Bluetooth for Java(更具体地说是Android)之上是否有TCP/IP协议栈实现?   java Android Studio通过intent传递ArrayList并填充ListView