[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

If you connect to http://localhost/testpage.html it renders the page
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



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

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

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

#frame, #header, #footer, #body {
       font-size:10pt; color:#000000;
       border-bottom:2px solid #FFCA49;
       border-left:2px solid #FFCA49;
       border-right:2px solid #FFCA49;
       border-top:2px solid #FFCA49;
       background: white;
       padding: 10px;

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

      <link rel="stylesheet" href="style.css" title="default" media="all">
<div id='frame'>
     <div id='header'>
     This is a header example
     <div id='body'>
     This is a body example
     <div id='footer'>
     This is a footer example
-------------- 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