Pyramid uses the standard mimetypes module to guess the type of mimetype based on the extension. It calls:
mimetypes.guess_type(path, strict=False)
The module scans the Windows registry, if on this platform and in the following places for mimetype lists:
knownfiles = [ "/etc/mime.types", "/etc/httpd/mime.types", # Mac OS X "/etc/httpd/conf/mime.types", # Apache "/etc/apache/mime.types", # Apache 1 "/etc/apache2/mime.types", # Apache 2 "/usr/local/etc/httpd/conf/mime.types", "/usr/local/lib/netscape/mime.types", "/usr/local/etc/httpd/conf/mime.types", # Apache 1.2 "/usr/local/etc/mime.types", # Apache 1.3 ]
You can either expand one of these files, or create your own file and add it to the module using the .init() function.
The file format is simple, just specify the mimetype type, then a space, then a list of extensions separated by spaces:
application/x-font-woff woff
source share