[Twisted-web] using css with nevow

Eric Medina eric.medina.atienza at gmail.com
Wed Oct 28 03:45:30 EDT 2009


I have been using twisted quite a bit these last 6 months for a networked
application i'm
working on. Recently, i've decided to port the web part of the app from
spyce to nevow.
However, i have encountered a problem with using css file. My css file has
references to
image files like below:

body {
    background: #EEE url(img/bg.gif);
    color: #444;
    font: normal 62.5% "Lucida Sans Unicode",sans-serif;
    margin: 0;

The following is a test file that loads an external xml file which
references a css file:

*class TestPage(rend.Page):
    addSlash = True
    child_images = static.File('img')
    children = {'default.css': static.File('default.css')}
    docFactory = loaders.xmlfile('webtest.html')

site = appserver.NevowSite(TestPage())
reactor.listenTCP(8080, site)

The problem is that the images referenced inside the css file is not being
loaded when
the page is rendered. Can someone tell me how to fix this? This is the first
time i've used
nevow or even twisted.web.

Thank you very much.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://twistedmatrix.com/pipermail/twisted-web/attachments/20091028/4a6b216a/attachment.htm 

More information about the Twisted-web mailing list