- 授权协议: BSD
- 开发语言: Python
- 操作系统: 跨平台
- 软件首页: http://weppy.org/
- 软件文档: http://weppy.org/docs
软件介绍
weppy 是一个全栈的 Python Web 框架,weppy 非常灵巧,易于理解学习和使用。兼容 Python 2.7, 3.3, 3.4, 3.5 和 3.6.
示例代码:
from weppy import App, request, response
from weppy.orm import Database, Model, Field
from weppy.tools import service, requires
class Task(Model):
name = Field('string')
is_completed = Field('bool', default=False)
app = App(__name__)
app.config.db.uri = "postgres://user:password@localhost/foo"
db = Database(app)
db.define_models(Task)
app.pipeline = [db.pipe]
def is_authenticated():
return request.headers["Api-Key"] == "foobar"
def not_authorized():
response.status = 401
return {'error': 'not authorized'}
@app.route(methods='get')
@service.json
@requires(is_authenticated, otherwise=not_authorized)
def todo():
page = request.query_params.page or 1
tasks = Task.where(
lambda t: t.is_completed == False
).select(paginate=(page, 20))
return {'tasks': tasks}weppy 可以让你直接用 Python 编写模板:
{{extend 'layout.html'}}
<div class="post-list">
{{for post in posts:}}
<div class="post">
<h2>{{=post.title}}</h2>
</div>
{{pass}}
{{if not posts:}}
<div>
<em>No posts here so far.</em>
</div>
{{pass}}
</div>深入解析Spring MVC与Web Flow
Seth Ladd、Darren Davison、Steven Devijver、Colin Yates / 徐哲、沈艳 / 人民邮电出版社 / 2008-11 / 49.00元
《深入解析Spring MVCgn Web Flow》是Spring MVC 和Web Flow 两个框架的权威指南,书中包括的技巧和提示可以让你从这个灵活的框架中汲取尽可能多的信息。书中包含了一些开发良好设计和解耦的Web 应用程序的最佳实践,介绍了Spring 框架中的Spring MVC 和Spring Web Flow,以及着重介绍利用Spring 框架和Spring MVC 编写Web ......一起来看看 《深入解析Spring MVC与Web Flow》 这本书的介绍吧!
