Pyramid网络框架¶
Pyramid 是一个小型、快速、实际的python web框架。它是作为 Pylons Project . 它是根据 BSD-like license .
这里有一个最简单的 Pyramid 您可以制作的应用程序:
from wsgiref.simple_server import make_server
from pyramid.config import Configurator
from pyramid.response import Response
def hello_world(request):
return Response('Hello World!')
if __name__ == '__main__':
with Configurator() as config:
config.add_route('hello', '/')
config.add_view(hello_world, route_name='hello')
app = config.make_wsgi_app()
server = make_server('0.0.0.0', 6543, app)
server.serve_forever()
安装后 Pyramid 并在您访问时运行此应用程序 http://localhost:6543/ 在浏览器中,您将看到文本 Hello World!
见 创建您的第一个 Pyramid 应用 有关此应用程序如何工作的完整解释。
入门¶
如果你是新来的Pyramid,我们有一些资源,可以帮助你尽快提高速度。
快速参观Pyramid 概述了Pyramid的主要特征,涵盖了很多。
比如以身作则?访问官方 教程 以及社区的贡献 Pyramid Tutorials 和 Pyramid Community Cookbook .
要获得建立Pyramid的帮助,请尝试 安装 Pyramid .
需要帮助吗?见 Support and Development .
教程¶
官方教程提供了对 Pyramid 的功能比快速浏览更深入,并使用工作代码,解释如何使用 Pyramid 构建各种类型的应用程序,以及如何部署 Pyramid 应用到各种平台。
支持和发展¶
这个 Pyramid website 主要入口点是 Pyramid 用于支持和开发信息的Web框架资源。
要报告错误,请使用 issue tracker .
如果您有本文档未解答的问题,请联系 Pylons-discuss maillist 或加入 #pyramid IRC channel 。
浏览并查看的标记和主干版本 Pyramid 通过 Pyramid GitHub repository . 通过检查后备箱 git
,使用以下任一命令:
# If you have SSH keys configured on GitHub:
git clone git@github.com:Pylons/pyramid.git
# Otherwise, HTTPS will work, using your GitHub login:
git clone https://github.com/Pylons/pyramid.git
了解如何成为 Pyramid 请看 How to Contribute Source Code and Documentation .
叙述性文件¶
章节形式的叙述性文件,解释如何使用 Pyramid .
API文档¶
各公开API的综合参考资料 Pyramid :
- API文档
pyramid.authentication
pyramid.authorization
- 常量
- 返回值
pyramid.config
pyramid.csrf
pyramid.decorator
pyramid.events
pyramid.exceptions
pyramid.httpexceptions
pyramid.i18n
pyramid.interfaces
pyramid.location
pyramid.paster
pyramid.path
pyramid.registry
pyramid.renderers
pyramid.request
pyramid.response
pyramid.scripting
pyramid.security
pyramid.session
pyramid.settings
pyramid.static
pyramid.testing
pyramid.threadlocal
pyramid.traversal
pyramid.tweens
pyramid.url
pyramid.view
pyramid.viewderivers
pyramid.wsgi
p*
脚本文档¶
p*
脚本包含在 Pyramid .