0

我正在使用 Sublime Text 2 作为我的编辑器并创建一个新的 Google App Engine 项目。

编辑:我正在通过 localhost 运行此代码。在 apppot 上查看应用程序时出现此错误: Status: 500 Internal Server Error Content-Type: text/plain Content-Length: 59 A server error occurred. Please contact the administrator.

我有这个代码:

import webapp2 as webapp
from google.appengine.ext.webapp.util import run_wsgi_app

class IndexPage(webapp.RequestHandler):
    def get(self):
        self.response.out.write('Hello, World!')

app = webapp.WSGIApplication([('/.*', IndexPage)], debug = True)

def main():
    run_wsgi_app(app)

if __name__ == '__main__':
    main()

它会导致 AssertionError:

文件“C:\Python27\lib\wsgiref\handlers.py”,第 202 行,写入

assert type(data) is StringType,"write() argument must be string"

AssertionError: write() 参数必须是字符串

错误是什么意思,可能是什么原因造成的?

4

1 回答 1

0

GAE 没有正确识别我的 app.yaml 文件。一旦我解决了这个问题,它就起作用了。谢谢

于 2013-09-24T15:15:00.080 回答