WN server filter won't work

Posted by Mike Fink on Stack Overflow See other posts from Stack Overflow or by Mike Fink
Published on 2010-05-31T22:39:21Z Indexed on 2010/05/31 22:43 UTC
Read the original article Hit count: 226

Filed under:
|

WN servers have an alternative to cgi programs called filters. I have been trying to get one to work, but I have had no luck. I am writing in python. It looks like the server is not receiving any output from the program but is parsing nothing and wrapping this nothing in my standard header and footer. I have chmod 755 the program and my index.wn file reads:

Default-Attributes=parse
Default-Wrappers=templates/template1.inc

File=includeTests.html
File=index.html
File=archives.html
File=contact.html

File=style.css

File=testProgram.py

#here is the stuff about the filter
File=testFilter.html
Content-type=text/html
Filter=testProgram.py
Attributes=parse, cgi

here is what is in the filter called testProgram.py:


#!/usr/bin/python

print "Content-Type: text/html\n\n"
print "

hi

"

testProgram.py works perfectly if it is shoved into a cgi-bin folder and chmoded. I suppose my problem may lay with the fact that I have never ever seen a filter program in python. I'm not sure I have even seen a filter program at all. Does anyone out there have any experience with wn servers and filters? Any ideas?

© Stack Overflow or respective owner

Related posts about python

Related posts about server