[SPAM] Re: [mod_python] Templaing question

marinus van aswegen mvanaswegen at gmail.com
Thu Mar 9 07:55:51 EST 2006


Hi Guys

I have figured it out, here is a quick summary.

problem: when I send a page to the browser via psp or req.write ( open
('file',r').read()) the
browser does not render the page correctly. I created three test functions
to do some basic testing
http://localhost/test/test[1,2,3]

If you connect to http://localhost/testpage.html it renders the page
correctly
If you connect to http://localhost/test/test[1,2,3] it renders the page
without applying the style sheet.

Solution (relevant files attached below)
If you parse a file via req.write ensure that all references to file contain
the full url.
I changed the url to http://localhost/style.css, and what do you know it
worked.

Regs

Marinus


http.conf -------------------------------------------

<Directory "/var/www">
    AddHandler mod_python .py
    PythonHandler mod_python.publisher
    PythonDebug On
</Directory>


style.css -------------------------------------------

#frame, #header, #footer, #body {
       font-family:arial,verdana,sans-serif;
       font-size:10pt; color:#000000;
       line-height:16px;
       border-bottom:2px solid #FFCA49;
       border-left:2px solid #FFCA49;
       border-right:2px solid #FFCA49;
       border-top:2px solid #FFCA49;
       background: white;
       padding: 10px;
       margin:5px;
}

testpage.html ----------------------------------------

<html>
      <link rel="stylesheet" href="style.css" title="default" media="all">
<body>
<div id='frame'>
     <div id='header'>
     This is a header example
     </div>
     <div id='body'>
     <%=data%>
     This is a body example
     </div>
     <div id='footer'>
     This is a footer example
     </div>
</div>
</body>
</html>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mm_cfg_has_not_been_edited_to_set_host_domains/pipermail/mod_python/attachments/20060309/a47027d8/attachment.html


More information about the Mod_python mailing list