Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
554 views
in Technique[技术] by (71.8m points)

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

Google is useless in this case, it seems I am the first to encounter this error :/ Works fine on my Mac, but using the same files on a Windows 8 rig gives the following error in the logs when trying to request static assets like CSS files and images. Here is a snippet of the error:

INFO     2014-06-08 14:42:28,431 module.py:639] default: "GET /css/rootStyles.css HTTP/1.1" 200 5454
ERROR    2014-06-08 14:42:28,431 module.py:714] Request to '/css/rootStyles.css' failed
Traceback (most recent call last):
  File "C:Program Files (x86)Googlegoogle_appenginegoogleappengineoolsdevappserver2module.py", line 710, in _handle_request
    return handler.handle(match, environ, wrapped_start_response)
  File "C:Program Files (x86)Googlegoogle_appenginegoogleappengineoolsdevappserver2static_files_handler.py", line 369, in handle
    return self._handle_path(full_path, environ, start_response)
  File "C:Program Files (x86)Googlegoogle_appenginegoogleappengineoolsdevappserver2static_files_handler.py", line 182, in _handle_path
    start_response('200 OK', headers)
  File "C:Program Files (x86)Googlegoogle_appenginegoogleappengineoolsdevappserver2module.py", line 640, in wrapped_start_response
    return start_response(status, response_headers, exc_info)
  File "C:Program Files (x86)Googlegoogle_appenginelibcherrypycherrypywsgiserverwsgiserver2.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-06-08 14:42:28,433 module.py:639] default: "GET /css/rootStyles.css HTTP/1.1" 500 -

My app.yml file looks like this:

application: foobarbaz
version: 1
runtime: python27
api_version: 1
threadsafe: yes

handlers:
- url: /favicon.ico
  static_files: favicon.ico
  upload: favicon.ico
- url: /img
  static_dir: img
- url: /font
  static_dir: font
- url: /css
  static_dir: css

- url: .*
  script: main.app

libraries:
- name: webapp2
  version: "2.5.2"
- name: jinja2
  version: latest
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...