0

For some reason I can not serve static content files. I have the following structure

root
    static
        css
            test.css
app.yaml

in app.yaml i have the following handler

handlers:
- url: /css
  static_dir: static/css

Now using the navigation bar of the browser (localhost:8080/css/test.css) I'm receiving in the network log error 404 (file not found)

user732456
  • 2,638
  • 2
  • 35
  • 49
  • Are there 2 spaces before `static_dir`? Are you getting any other errors? – GAEfan Jun 20 '14 at 14:00
  • Yep, there are 2 spaces before static_dir. When I try to reference the test.css trough application the error code is 500 (internal server error). – user732456 Jun 20 '14 at 14:30
  • What is the actual error? – Tim Jun 20 '14 at 14:35
  • this is a partial trace of the application running in debug mode: INFO 2014-06-20 17:57:28,733 module.py:639] default: "GET /css/test.css HTTP/1.1" 200 42 ERROR 2014-06-20 17:57:28,733 module.py:714] Request to '/css/test.css' failed TypeError: WSGI response header value u'text/css' is not of type str. – user732456 Jun 20 '14 at 15:07
  • I found the resolution , sadly I don't know why it happened. So if anyone can explain I would gladly listen and remember. The resolution is to add (mime_type: "text/css") in the handler for static files – user732456 Jun 20 '14 at 15:13

1 Answers1

0

This isn't your fault -- it's a bug in App Engine: https://code.google.com/p/googleappengine/issues/detail?id=11001

There's a thread with some workarounds here: Google App Engine: Won't serve static assets with below error:

Community
  • 1
  • 1
Sam King
  • 2,068
  • 18
  • 29