几个月前,我正在开发一个测试GAE应用程序。我能够启动启动器并在应用程序端口和SDK控制台端口上打开浏览器,它们都运行良好。
然后我安装了CherryPy,我创建了一个CherryPy应用程序,然后我就可以浏览应用程序了。
今天我重新启动了GAE启动器。当我浏览到我的应用页面时,一切运行良好,在浏览到SDK控制台时,它会显示正确的内容,但不会显示静态文件。
日志提到了CherryPy。
例如,当我浏览到http://localhost:8002/assets/common.css
(这是SDK控制台使用的css)时,我得到以下日志:
ERROR 2014-08-19 20:23:08,052 webapp2.py:1553] WSGI response header value u'text/css' is not of type str.
Traceback (most recent call last):
File "C:\Program Files (x86)\Google\google_appengine\lib\webapp2-2.5.1\webapp2.py", line 1547, in __call__
return response(environ, start_response)
File "C:\Program Files (x86)\Google\google_appengine\lib\webob-1.2.3\webob\response.py", line 1021, in __call__
start_response(self.status, headerlist)
File "C:\Program Files (x86)\Google\google_appengine\lib\cherrypy\cherrypy\wsgiserver\wsgiserver2.py", line 2155, in start_response
raise TypeError("WSGI response header value %r is not of type str." % v)
TypeError: WSGI response header value u'text/css' is not of type str.
AssertionError('WSGI start_response called a second time with no exc_info.',)
Traceback (most recent call last):
File "C:\Program Files (x86)\Google\google_appengine\lib\cherrypy\cherrypy\wsgiserver\wsgiserver2.py", line 1302, in communicate
req.respond()
File "C:\Program Files (x86)\Google\google_appengine\lib\cherrypy\cherrypy\wsgiserver\wsgiserver2.py", line 831, in respond
self.server.gateway(self).respond()
File "C:\Program Files (x86)\Google\google_appengine\lib\cherrypy\cherrypy\wsgiserver\wsgiserver2.py", line 2115, in respond
response = self.req.server.wsgi_app(self.env, self.start_response)
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\devappserver2\wsgi_server.py", line 266, in __call__
return app(environ, start_response)
File "C:\Program Files (x86)\Google\google_appengine\lib\webapp2-2.5.1\webapp2.py", line 1549, in __call__
return self._internal_error(e)(environ, start_response)
File "C:\Program Files (x86)\Google\google_appengine\lib\webob-1.2.3\webob\response.py", line 1021, in __call__
start_response(self.status, headerlist)
File "C:\Program Files (x86)\Google\google_appengine\lib\cherrypy\cherrypy\wsgiserver\wsgiserver2.py", line 2137, in start_response
raise AssertionError("WSGI start_response called a second "
AssertionError: WSGI start_response called a second time with no exc_info.
答案 0 :(得分:2)
GAE Windows静态文件处理中存在错误。它已在此处记录:
Google App Engine: Won't serve static assets with below error:
报告通过从Python 2.7.7更新到2.7.8来修复。否则,您需要在app.yaml中明确指定静态文件的MIME类型,如链接页面所示。