gpt4 book ai didi

html - App Engine GO SDK 加载 CSS 文件出现 500 错误

转载 作者:行者123 更新时间:2023-11-28 15:27:49 24 4
gpt4 key购买 nike

我使用 App Engine GO 在本地创建了一个测试应用。我在同一个文件夹中有 bootstrap.css 和 bootstrap.js,这两个文件的内容完全相同。文件路径和处理程序如下。

css/bootstrap/bootstrap.css

css/bootstrap/bootstrap.js

handlers:

  • url: /css

static_dir: css

加载 bootstrap.js (localhost:8080/css/bootstrap/bootstrap.js) 工作正常。但是bootstrap.css (localhost:8080/css/bootstrap/bootstrap.css) 根本无法加载,出现500 Internal Server Error。服务器日志如下。

c:\Apps\Google\appProjects\myapp>goapp serve

INFO 2014-07-19 08:57:00,200 devappserver2.py:765] Skipping SDK update check .

WARNING 2014-07-19 08:57:00,211 api_server.py:374] Could not initialize images API; you are likely missing the Python "PIL" module.

INFO 2014-07-19 08:57:00,230 api_server.py:171] Starting API server at: http ://localhost:49980

INFO 2014-07-19 08:57:00,236 dispatcher.py:182] Starting module "default" ru nning at: http ://localhost:8080

INFO 2014-07-19 08:57:00,242 admin_server.py:117] Starting admin server at: http ://localhost:8000

INFO 2014-07-19 08:58:26,872 module.py:627] default: "GET / HTTP/1.1" 200 13 50

INFO 2014-07-19 08:58:26,914 module.py:627] default: "GET /css/bootstrap/boo tstrap.js HTTP/1.1" 304 -

INFO 2014-07-19 08:58:27,943 module.py:627] default: "GET /favicon.ico HTTP/ 1.1" 200 1354

INFO 2014-07-19 08:58:37,127 module.py:627] default: "GET /css/bootstrap/boo tstrap.js HTTP/1.1" 304 -

INFO 2014-07-19 08:58:38,219 module.py:627] default: "GET /favicon.ico HTTP/ 1.1" 200 1354

INFO 2014-07-19 08:59:38,157 module.py:627] default: "GET /css/bootstrap/boo tstrap.css HTTP/1.1" 200 145168

ERROR 2014-07-19 08:59:38,157 module.py:675] Request to '/css/bootstrap/boots trap.css' failed

Traceback (most recent call last):

File "C:\Apps\Google\go_appengine\google\appengine\tools\devappserver2\module. py", line 671, in _handle_request

return handler.handle(match, environ, wrapped_start_response)

File "C:\Apps\Google\go_appengine\google\appengine\tools\devappserver2\static_ files_handler.py", line 326, in handle

return self._handle_path(full_path, environ, start_response)

File "C:\Apps\Google\go_appengine\google\appengine\tools\devappserver2\static_ files_handler.py", line 181, in _handle_path

start_response('200 OK', headers)

File "C:\Apps\Google\go_appengine\google\appengine\tools\devappserver2\module. py", line 628, in wrapped_start_response

return start_response(status, response_headers, exc_info)

File "C:\Apps\Google\go_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.

INFO 2014-07-19 08:59:38,161 module.py:627] default: "GET /css/bootstrap/boo tstrap.css HTTP/1.1" 500 -

INFO 2014-07-19 08:59:39,178 module.py:627] default: "GET /favicon.ico HTTP/ 1.1" 200 1354

看起来有“TypeError”。如何修复此错误?如何加载CSS文件?

最佳答案

Windows 的 app.yaml 静态处理程序中存在错误:

Google App Engine: Won't serve static assets with below error:

关于html - App Engine GO SDK 加载 CSS 文件出现 500 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24836687/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com