Fixing server mimetypes on OSX

This commit is contained in:
Ben Vanik 2012-10-17 18:23:20 -07:00
parent 3545d7e5f8
commit 014c540b44
1 changed files with 5 additions and 0 deletions

View File

@ -77,6 +77,11 @@ class ServeCommand(ManageCommand):
port: TCP port to listen on.
root_path: Root path of the HTTP server.
"""
# Twisted has a bug where it doesn't properly initialize mimetypes
# This must be done before importing it
import mimetypes
mimetypes.init()
from twisted.internet import reactor
from twisted.web.resource import Resource, NoResource
from twisted.web.server import Site