欢迎来到web.py 0.3的Cookbook。提醒您注意:某些特性在之前的版本中并不可用。当前开发版本是0.3。
格式
在编排内容时,请尽量使用cookbook格式...如:
问题:如何访问数据库中的数据?
解法:使用如下代码...
请注意,网址中不必含有"web"。如"/cookbook/select",而非"/cookbook/web.select"。
该手册适用于0.3版本,所以您在添加代码时,请确认代码能在新版本中工作。
基本应用:
高级应用
- 用web.ctx获得客户端信息
- 应用处理器,添加钩子和卸载钩子
- 如何使用web.background
- 自定义NotFound信息
- 如何流传输大文件
- 对自带的webserver日志进行操作
- 用cherrypy提供SSL支持
- 实时语言切换
Sessions and user state:
- 如何使用Session
- 如何在调试模式下使用Session
- 在template中使用session
- 如何操作Cookie
- 用户认证
- 一个在postgreSQL数据库环境下的用户认证的例子
- 如何在子应用中操作Session
Utils:
Templates 模板
- Templetor: web.py 模板系统
- Using Site Layout Templates (未译)
- Alternating Style (未译)
- Import functions into templates (未译)
- 模板文件中的i18n支持
- Use Mako template engine in webpy
- Use Cheetah template engine in webpy (未译)
- 在web.py中使用Jinja2模板引擎
- How to use templates on Google App Engine (未译)
Testing:
User Input:
- 文件上传
- Store an uploaded file (未译)
- How to put a limit of size of uploaded files (未译)
- 通过 web.input 接受用户输入
- How to use forms (未译)
- Render individual form fields (未译)
Database 数据库
- 使用多数据库
- Select: 查询数据
- Update: 更新数据
- Delete: 删除数据
- Insert: 新增数据
- Query: Advanced database queries (未译)
- How to use database transactions (未译)
- 使用 sqlalchemy
- Integrating SQLite UDF (user-defined-functions) with webpy database layer (未译)
- Using a dictionary as where clause (未译)
Deployment:
- Fastcgi deployment through lighttpd (未译)
- Fastcgi deployment through Apache (未译)
- CGI deployment through Apache (未译)
- mod_python deployment through Apache (requested)
- mod_wsgi deployment through Apache (未译)
- mod_wsgi deployment through Nginx (未译)
- Fastcgi deployment through Nginx (未译)
Subdomains:
- Subdomains and how to access the username (requested)
