web.py Cookbook
Other languages: 简体中文 | 日本語 | Français |
Basics
- Hello World
- Serving Static Files
- Understanding URL handling
- Seeother and Redirect
- using subapplications
- Serving XML
- Reading raw data from post
Advanced
- Contextual and Environment variables - web.ctx
- Application processors, loadhooks and unloadhooks
- How to use web.background
- Custom NotFound message
- How to Stream Large Files
- Control over logging for default HTTPServer
- SSL support in built-in cherrypy server
- Run-time language switch
Sessions and user state
- Working with Session
- Using session with reloader
- Using session in template
- Working with Cookies
- User authentication
- User authentication with http basic auth (RFC2617)
- User authentication with Postgresql database
- Sessions with sub-apps
- Unpack session stored in postgresql
Utils
Templates
- Templetor: The web.py templating system
- Using Site Layout Templates
- Alternating Style
- Import functions into templates
- i18n support in template file
- Use Mako template engine in webpy
- Use Cheetah template engine in webpy
- Use Jinja2 template engine in webpy
- How to use templates on Google App Engine
- Concatenate two rendered templates
Testing
User input
- File Upload
- Store an uploaded file
- How to put a limit of size of uploaded files
- Accessing user input through web.input
- How to use forms
- Render individual form fields
- How to protect forms from CSRF attacks
Databases
- Multiple databases
- Select: Retrieving entries from a database
- Update: Updating entries in a database
- Delete: Remove entries in a database
- Insert: Adding entries to a database
- Query: Advanced database queries
- How to use database transactions
- Using 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 on Red Hat
- mod_wsgi deployment through Apache on Ubuntu
- mod_wsgi deployment through Nginx
- Fastcgi deployment through Nginx
- uWSGI service deployment through Nginx on Linux
- PyISAPIe deployment through IIS7/IIS6
- Deploying as a google app engine application
Subdomains
- Subdomains and how to access the username (requested)