Re: twisted web and css files
[email protected] Mon, 26 Nov 2012 13:51:55 -0000
| Newsgroups | gmane.comp.python.twisted.web |
|---|---|
| Message-ID | <20121126135155.3980.1713420192.divmod.xquotient.17@localhost6.localdomain6> |
On 12:39 pm, [email protected] wrote: >I seem to have a problem processing css files with twisted.web using >twisted templates. > > >I get a message in my Firefox error console saying that it could not >load >the css file since the type was text/html not text/css 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