page contents are not refreshed

Steve Holden steve at holdenweb.com
Wed Sep 13 20:59:56 CEST 2006


Gleb Rybkin wrote:
> when running apache, mod_python in windows.
> 
> This looks pretty strange. Creating a simple python file that shows
> current time will correctly display the time in apache the first time,
> but freezes afterwards and shows the same time on all subsequent clicks
> as long as the file is not modified.
> 
> Any ideas what's wrong? Thanks.
> 
> from mod_python import apache
> from time import strftime, gmtime
> 
> curtime = strftime("%a, %d %b %Y %H:%M:%S +0000", gmtime())
> def handler(req):
>      req.content_type = "text/plain"
>      req.send_http_header()
>      req.write(str(curtime))
>      return apache.OK
> 
Try moving the assignment to curtime inside the handler function so it 
isn't just executed once when the module is imported ...

regards
  Steve
-- 
Steve Holden       +44 150 684 7255  +1 800 494 3119
Holden Web LLC/Ltd          http://www.holdenweb.com
Skype: holdenweb       http://holdenweb.blogspot.com
Recent Ramblings     http://del.icio.us/steve.holden




More information about the Python-list mailing list