ich habe ein Problem mit CherryPY.
Wie schaffe ich es, dass ich ohne den
eigenen Webserver von CherryPY Seiten
zum laufen bekomme ?
Ich habe folgendes Script als test.fcgi:
Code: Alles auswählen
#!/usr/bin/env python
"""
Tutorial - Passing variables
This tutorial shows you how to pass GET/POST variables to methods.
"""
import cherrypy
class WelcomePage:
def index(self):
return '''
<form action="greetUser" method="GET">
What is your name?
<input type="text" name="name" />
<input type="submit" />
</form>'''
index.exposed = True
def greetUser(self, name = None):
if name:
return "Hey %s, what's up?" % name
else:
if name is None:
return 'Please enter your name <a href="./">here</a>.'
else:
return 'No, really, enter your name <a href="./">here</a>.'
greetUser.exposed = True
app = cherrypy.tree.mount(WelcomePage(), '/')
if __name__ == '__main__':
cherrypy.engine.start(blocking=False)
from flup.server.fcgi import WSGIServer
WSGIServer(app, bindAddress = '/tmp/fcgi.sock').run()
Code: Alles auswählen
python test.fcgi
bekomme ich immer nur eine 404 Fehlerseite von
CherryPy.
Code: Alles auswählen
404 Not Found
The path '/test.fcgi' was not found.
Traceback (most recent call last):
File "/usr/lib/python2.5/site-packages/CherryPy-3.0.1-py2.5.egg/cherrypy/_cprequest.py", line 551, in respond
cherrypy.response.body = self.handler()
File "/usr/lib/python2.5/site-packages/CherryPy-3.0.1-py2.5.egg/cherrypy/_cperror.py", line 198, in __call__
raise self
NotFound: (404, "The path '/test.fcgi' was not found.")
Powered by CherryPy 3.0.1
Kann mir vielleicht jemand zeigen wie ich das richtig mache ?
Schön mal vielen Dank im voraus.