Thursday, September 25, 2014

Adding MIME Types for Fonts in EC2 using Python

By Default EC2 does not include mime types for fonts except svg in  /etc/mime.types

So need to add them to the system

Below code example tells you how to do that in python

import mimetypes
mimetypes.add_type('font/ttf', '.ttf')
mimetypes.add_type('font/opentype', '.otf')
mimetypes.add_type('application/font-woff', '.woff')
mimetypes.add_type('application/', '.eot')

For more Information please visit

No comments:

Post a Comment