visit this url, I got 404:
File does not exist: /home/68886/domains/
autopart.hi0791.com/html/test.py/$ python test.py
WSGIServer: missing FastCGI param REQUEST_METHOD required by WSGI!
WSGIServer: missing FastCGI param SERVER_NAME required by WSGI!
WSGIServer: missing FastCGI param SERVER_PORT required by WSGI!
WSGIServer: missing FastCGI param SERVER_PROTOCOL required by WSGI!
Status: 404 Not Found
Content-Type: text/html
Content-Length: 9
how can I fix this problem? thanks.
# test.py
#!/usr/bin/env python
# coding: utf-8
import web
web.config.debug = True
urls = ('/', 'Index')
class Index:
def GET(self):
return 'this is a test web, bulid with webpy(
webpy.org), version ' + web.__version__ + "OK"
if __name__ == "__main__":
web.wsgi.runwsgi = lambda func, addr=None: web.wsgi.runfcgi(func, addr)
app = web.application(urls, globals())
app.run()
# .htaccess
<Files test.py>
SetHandler fastcgi-script
</Files>
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_URI} !^/static
RewriteCond %{REQUEST_URI} !^(/.*)+
test.py/ RewriteRule ^(.*)$
test.py/$1 [PT]
</IfModule>
--
百才招聘(
baicai.com).产品部
Email:
k...@baicai.comGtalk:
qicha...@gmail.com
twitter.com/qichangxing