[mod_python] mod_python and css

Sean Gillies sgillies at frii.com
Wed Dec 31 07:42:41 EST 2003


On Dec 31, 2003, at 2:57 AM, Red Conecta wrote:

> I'm trying to use css with the publisherhandler; here is the code:
>
>    def _inicio():
>        ini= '''<head><title>nombredelsitio</title>
>                  <link rel="stylesheet" href="estilo.css"
>    Type="text/css"></head>
>                  <body leftmargin=0 rightmargin=0 topmargin=0
>    bottommargin=0>'''
>              return ini
>
>    def _final():
>        return '</body></html>'
>
>    def mostrar(req,direccion='/'):
>        req.content_type = "text/html"
>        html=_inicio()
>        obj=leerobjeto(direccion)
>        if obj!=None:
>            for i in obj.__dict__:html+=i+': '+obj.__dict__[i]+'<br>'
>        else:html+='error'
>        html+=_final()
>        return html
>
> the output doesn't use the estilo.css archive but if I save the page 
> in 'mostrar.html' all is ok.
>

Try "../estilo.css", this will link to the stylesheet in the same
location as the published module.

cheers,
Sean

--
Sean Gillies
sgillies at frii dot com
http://users.frii.com/sgillies



More information about the Mod_python mailing list