在我的Google App Engine應(yīng)用中,出現(xiàn)錯誤ImportError:沒有名為main的模塊轉(zhuǎn)到URL時/foo。我的應(yīng)用程序中的所有文件都位于父目錄中。這是我的app.yaml:application: foobarversion: 1runtime: python27api_version: 1threadsafe: nohandlers:- url: /foo.* script: main.application- url: / static_files: index.html- url: /(.*\.(html|css|js|gif|jpg|png|ico)) static_files: \1 upload: .* expiration: "1d"這是我的main.py:from google.appengine.ext import webappfrom google.appengine.ext.webapp import utilclass Handler(webapp.RequestHandler): def get(self): self.response.headers['Content-Type'] = 'text/plain' self.response.write('Hello world!') def main(): application = webapp.WSGIApplication([('/foo', Handler)], debug=False) util.run_wsgi_app(application)if __name__ == '__main__': main()當我更改main.application為main.py或時,我會遇到相同的錯誤main。為什么會發(fā)生此錯誤?
添加回答
舉報
0/150
提交
取消