I've got a small problem where google app engine is complaining about my ttf file. This is what it says:
Could not guess mimetype for css/fonts/Pacifico.ttf. Using application/octet-stream.
Now I've followed this link and changed my yaml file appropriately (or so I think):
- url: /css/fonts/(.*\.ttf)
static_files: css/fonts/\1
upload: css/fonts/(.*\.ttf)
mime_type: application/x-font-ttf
But when I do this i get the following:
appcfg.py: error: Error parsing C:\Users\Roberto\Desktop\bootstrap\app.yaml: mapping values are not allowed here
in "C:\Users\Roberto\Desktop\bootstrap\app.yaml", line 25, column 17.
2014-01-16 23:22:16 (Process exited with code 2)
Any help in this matter?
I have done a test with glyphicons-halflings-regular.ttf from the Bootstrap project with the same app.yaml handler that you use (save for the indentation change as per the comments) and can verify that it works as expected:
This leads me to believe that you may using an older version of the GAE SDK (I use 1.8.8) or something else is wrong with your installation.
You can try this: appcfg.py
uses python's mimetypes
module to guess the type from the file extension so in any case, you should be able to solve the issue by adding the application/x-font-ttf
mime type to your OS.
You're on Windows so you need to edit your registry and add a application/x-font-ttf
key to HKEY_CLASSES_ROOT\MIME\Database\Content Type
and add a string value called Extension
with the value .ttf
under the new key.
regedit
, hit EnterHKEY_CLASSES_ROOT
, inside it open MIME
, inside that open Database
and inside that open Content Type
. It's like a folder structure. Content Type
and select New > Key
, give it the name application/x-font-ttf
.New > String Value
. give it the name Extension
..ttf
, hit OK.Final none: I don't think it can be anything to do with the file itself, because the mimetypes
module uses only the file extension to work out the MIME type. Unless there is some crazy unprintable character in the filename. You could try using the glyphicons-halflings-regular font I linked to to eliminate this possibility.