首页 > AttributeError module object has no attribute application

AttributeError module object has no attribute application

import web

urls = (

'/', 'index'

)

class index:

def GET(self):
    return "Hello, world!"

if name == "__main__":

app = web.application(urls, globals())
app.run()

以上为代码,有人曾提过这个问题,但我还是不明白该怎么解决。


应该是命名冲突了,没有import正确的web模块。比如当前路径有web.py这个文件。

【热门文章】
【热门文章】