注册 登录
编程论坛 Python论坛

webpy问题,两个页面就报错!!!apache wsgi python2.6

haozixxat126 发布于 2011-06-17 17:23, 992 次点击
说明:写两个请求就报错,单独一个没有问题!!!
代码如下:code.py

程序代码:
import web

urls = (
    '/index', 'index'
#    '/hello', 'hello'
)

class index:
    def GET(self):
        return  "111hello world"
        #return render.base(view.listing())
#
class hello:
#
    def GET(self):
#
        return "Hello, webpy!"

application = web.application(urls, globals()).wsgifunc()
apache配置如下:
程序代码:
WSGIScriptAlias /webpy "/var/www/webpy/code.py/"
Alias /webpy/static "/var/www/webpy/static/"

<Directory "/var/www/webpy">
    Order allow,deny
    Allow from all
</Directory>

求解~~~
1 回复
#2
静夜思2011-07-06 18:15
程序代码:
import web

urls = (
    '/index', 'index', #注意这里有个逗号,最好下面的那行也以逗号结尾
#
    '/hello', 'hello'
)


urls本质上就是一个元组,元组的元素间用逗号隔开
1