再见!
https://developers.google.com/appengine/docs/python/gettingstarted/helloworld
这就是我要运行的hello world。
我可以看到
Hello, world!
Status: 500
留言。但是,在我点击刷新之后,它将变成“HTTP错误500”。
还有。。。似乎只有在我重新保存后,才能看到一次好的结果应用程序yaml或者地狱世界.py
这是好结果的痕迹
这是误差500的轨迹
Traceback (most recent call last):
File "C:\Program Files\Google\google_appengine\google\appengine\runtime\wsgi.py", line 187, in Handle
handler = _config_handle.add_wsgi_middleware(self._LoadHandler())
File "C:\Program Files\Google\google_appengine\google\appengine\runtime\wsgi.py", line 239, in _LoadHandler
raise ImportError('%s has no attribute %s' % (handler, name))
ImportError: <module 'helloworld' from 'D:\work\[GAE] tests\helloworld\helloworld.pyc'> has no attribute app
INFO 2012-06-23 01:47:30,127 dev_appserver.py:2891] "GET /hello HTTP/1.1" 500 -
这是我的地狱世界.py在
print 'Content-Type: text/plain'
print ''
print 'Hello, world!'
我的主.py. (应用程序代替应用程序)
import webapp2
class hello(webapp2.RequestHandler):
def get(self):
self.response.out.write('normal hello')
app = webapp2.WSGIApplication([
('/', hello),
], debug = True)
以及应用程序yaml在
application: helloworld
version: 1
runtime: python27
api_version: 1
threadsafe: true
handlers:
- url: /favicon\.ico
static_files: favicon.ico
upload: favicon\.ico
- url: /hello
script: helloworld.app
- url: /.*
script: main.app
libraries:
- name: webapp2
version: "2.5.1"
有什么线索吗?
谨致问候
您没有在地狱世界.py模块。在
看到线了吗
在你的主.py文件?这就产生了主.app对象中的
script: main.app
处理程序引用的应用程序yaml. 在您在上面几行引用了一个
helloworld.app
对象;该对象不存在。python2.7in-appengine不支持简单模块模型no-WSGI处理程序,只是2.5“Hello World”演示中使用的一个简单脚本。在正如presveva所说,使用2.7入门指南可以减少混乱。在
相关问题 更多 >
编程相关推荐