web.redirect 和 web.seeother问题
响应 XML 文件
Site Layout TemplateProblem How do I use a site-wide base template that displays across every page? (In other frameworks, this is called template inheritance.)
1. 通常用:
Nginx+mod_wsgi+webpy
哪位搞过nginx + fcgi + webpy 我配完后无法解析css,配置如下 server { listen 88; root /usr/local/nginx/html/trace; location ~* \.(js|css|jpg|jpeg|gif|png|ico|html|txt)$ { if (-f $request_filename) { expires max; break; } } location /static/ { #root /usr/local/nginx/html/trace/static; if (-f $request_filename) { rewrite ^/static/(.*)$ /static/$1 br...
转:caoxx
URL自动映射
web.auto_application() 类似于 web.application() ,但自动根据元类来构造 urls
下面的Demo中URL自动映射不知为何没有效果。
后来发现元类名小写才可以正常,不知自动构造URL是否对元类名书写有规范。
class hello(app.page):[code]# -*- coding:utf-8 -*-
import web
app = web.auto_application()
class Hello(app.page):
def GET(self):
return '''
转:wangfsec 用memcache处理webpy的session 目前用的webpy0.34里没有对session提供memcache后端,自己参照其它的Store写了一个。 Python代码[code]1.import memcache as memcache 2.from web.session import Store 3. 4.class MemcacheStore(Store): 5. def __init__(self, config): 6. ''''' 7. config = { 8. 'servers': ['127.0.0.1:11211'], 9. 'timeout': 1440 ...