1
I'm trying to deploy a very simple web.py app to my Bluehost website using these instructions. Here's my main python file:
#!/usr/bin/python
import web
from web import form
import whitelistchecker
render = web.template.render('templates/')
urls = ('/', 'index')
app = web.application(urls, globals())
myform = form.Form(
form.Textarea('whitelist', description = "", rows = 10, cols = 50)
)
output = None
class index:
def GET(self):
form = myform()
return render.inputform(form, output)
def POST(self):
form = myform()
if not form.validates():
return render.inputform(form, output)
else:
return render.inputform(form, whitelistchecker.ReportRejectedSevere(form['whitelist'].value))
web.wsgi.runwsgi = lambda func, addr=None: web.wsgi.runfcgi(func, addr)
if __name__=="__main__":
web.internalerror = web.debugerror
app.run()
It runs fine locally without the web.wsgi.runwsgi
line.
Here's my .htaccess
file:
allow from all
SetHandler fcgid-script
Options +ExecCGI
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ interface.py/$1 [PT]
It's exactly the same as in the tutorial. Both of these files are in the same directory in my public_html
directory, with some other files for this app (templates and utilities-- not related to deployment). I am getting these errors:
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
I'm not sure how to fix that. Help is appreciated. I also couldn't get the exact same code as the tutorial to run, so I don't think it's just my code.