TurboGears Python 的 Web 框架开源项目

我要开发同款
匿名用户2008年09月17日
127阅读

技术信息

开源地址
https://gitee.com/mirrors/TurboGears
授权协议
MIT

作品详情

TurboGears是为Pytho提供网页前端到后端整合的网站框架,让网站开发更加快速和容易。

安装pip:

$curl-O'https://bootstrap.pypa.io/get-pip.py'$pythoget-pip.py

安装 Turbogears:

$pipistallTurboGears2

开发一个简单的TGweb应用:

fromwsgiref.simple_serverimportmake_serverfromtgimportMiimalApplicatioCofiguratorfromtgimportexpose,TGCotroller#RootCotrollerofourwebapp,ichargeofservigcotetfor/classRootCotroller(TGCotroller):@expose(cotet_type="text/plai")defidex(self):retur'HelloWorld'#Cofigureaewmiimalapplicatiowithourrootcotroller.cofig=MiimalApplicatioCofigurator()cofig.update_blueprit({'root_cotroller':RootCotroller()})#Servetheewlycofiguredwebapplicatio.prit("Servigoport8080...")httpd=make_server('',8080,cofig.make_wsgi_app())httpd.serve_forever()

使用命令 pythowebapp.py 启动,并打开浏览器访问 https://localhost:8080/

 

安装指南:https://docs.turbogears.org/1.0/Istall

功能介绍

TurboGears是为Python提供网页前端到后端整合的网站框架,让网站开发更加快速和容易。 安装 pip:
$ curl -O 'https://bootstrap.pypa.io/g...

示例图片

声明:本文仅代表作者观点,不代表本站立场。如果侵犯到您的合法权益,请联系我们删除侵权资源!如果遇到资源链接失效,请您通过评论或工单的方式通知管理员。未经允许,不得转载,本站所有资源文章禁止商业使用运营!
下载安装【程序员客栈】APP
实时对接需求、及时收发消息、丰富的开放项目需求、随时随地查看项目状态

评论