[Twisted-web] twisted web and css files

John Aherne johnaherne at rocs.co.uk
Mon Nov 26 12:22:18 EST 2012

> It sounds like the css is being served with a "Content-Type: text/html"
> header instead of a "Content-Type: text/css" header.  You should double
> check this using another tool (eg HEAD(1) or telnet(1)).  If this is the
> case, then you may need to add css to your site-wide mime.types file
> (sounds gross, I know, sorry) or add the necessary item to the mapping
> loaded by Twisted Web.
> See `twisted.web.static.File.contentTypes`.  If it does not have an
> entry for css, or has the wrong content-type for it, that's the problem.
> Since you mention running on Windows, I think this is a likely
> explanation; it wouldn't surprise me if Windows didn't include a very
> complete mime types database (or one at all, or Twisted Web doesn't know
> how to load it).
> Jean-Paul
> _______________________________________________
> Twisted-web mailing list
> Twisted-web at twistedmatrix.com
> http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-web

Thanks for the info.

I have checked out contentTypes and it would appear to be present {css:

What I have not been able to pin down is where the content type is being
set or unset or being left as html.

Chrome seems to read in the css file but still does not do what I expect.
Firefox still says it will not load the resource.

So everyone can find it but they all say it is typed as text/html.

I imagine no one else has seen this, since all the comments I see say that
once they set up the static File it all starts to work.

Looks like more ploughing through docs and code.


John Aherne

*John Aherne*
020 7223 7567
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://twistedmatrix.com/pipermail/twisted-web/attachments/20121126/7f8f9ebc/attachment.htm 

More information about the Twisted-web mailing list