1

I'm having trouble with a static view, it is configured to serve files from the 'assets' folder on the server, and works fine for the following '/assets/img/hdr.png','/assets/style/default.css' however when trying to serve a web font it always returns 404 not found (despite the fact I have triple checked the file is in the correct locaiton ('/assets/font.woff')

Is there something additional I need to configure to allow non img/css files to be served?

config.add_static_view(name='assets', path='assets')

Thanks

  • I don't know what library your using but try and force the Content-Type to "application/font-woff" (not tested) – Joe Doherty Dec 19 '12 at 20:56
  • This questinos seams to serve your needings. [stackoverflow add_static_view][1] [1]: http://stackoverflow.com/questions/11689841/how-does-pyramids-add-static-view-work – nuxxxx Dec 19 '12 at 20:59

2 Answers2

2

The path argument should be an asset specification. This means you should prefix the path with the name of your package mypkg:assets.

Michael Merickel
  • 23,153
  • 3
  • 54
  • 70
0

Not sure if it's still relevant to the OP, but I hit the same problem.

The reason was that setup.py install simply didn't copy the font files, and the solution was to include all the font extensions in the MANIFEST.in file.

Omri Barel
  • 9,182
  • 3
  • 29
  • 22