The path '/' was not found.
Traceback (most recent call last):
File "/usr/local/lib/python2.7/site-packages/CherryPy-3.1.2-py2.7.egg/cherrypy/_cprequest.py", line 606, in respond
cherrypy.response.body = self.handler()
File "/usr/local/lib/python2.7/site-packages/CherryPy-3.1.2-py2.7.egg/cherrypy/_cperror.py", line 227, in __call__
raise self
NotFound: (404, "The path '/' was not found.")
this is the code:
# main.py import cherrypy import wsgiref.handlers class HelloWorld: @cherrypy.expose def index(self): return "Hello world!" class GoodbyeWorld: @cherrypy.expose def index(self,num=None): return "Goodbye World!" def main(): hw = HelloWorld() gw = GoodbyeWorld() mapper = cherrypy.dispatch.RoutesDispatcher() mapper.connect('home',"/",controller=hw) mapper.connect('hello','/hello',controller=hw) mapper.connect('goodbye','/goodbye',controller=gw) app = cherrypy.tree.mount(None,config={"/":{"request.dispatch": mapper}}) wsgiref.handlers.CGIHandler().run(app) if __name__ == '__main__': main()
someone please help. what am i missing..i want to know ,where i can find more examples of routesdispatcher in cherrypy.