[Twisted-Python] twisted.web.static.File and MIME types

Tobias Oberstein tobias.oberstein at tavendo.de
Sat Jul 7 05:43:15 EDT 2012


Hi,

I need to add MIME types to twisted.web.static.File.

The following works, but seems to use internal stuff .. whats the "correct" way to do?


from twisted.web.static import File

webdir = File(".")
webdir.contentTypes['.crt'] = 'application/x-x509-ca-cert'


http://twistedmatrix.com/documents/12.1.0/api/twisted.web.static.File.html


Cheers,
Tobias




More information about the Twisted-Python mailing list