[mod_python] mod_python and css

Red Conecta redconectabilbao at telefonica.net
Fri Jan 2 09:34:52 EST 2004


theman at stellar.eradman.com escribió:

>One thing to watch out for is that when you're calling pages using the http://domain/script/function relative paths do not work corrrectly. So instead of href="estilo.css" it probably needs to be href="/estilo.css".
>
>Eric Radman
>theman at eradman.com
>
>Wed, Dec 31, 2003 at 10:57:31AM +0100, 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.
>>
>>_______________________________________________
>>Mod_python mailing list
>>Mod_python at modpython.org
>>http://mailman.modpython.org/mailman/listinfo/mod_python
>>    
>>
>
>  
>
I've tryed /estilo.css, ./estilo.css, ../estilo.css and 
/var/www/html/portal/estilo.css, but it still doesn't work



More information about the Mod_python mailing list