Hello
I started from the demo wsgi file for cherrypy but wanted to know how to mount two cherrypy app (or Python classes) to two differents mount point ?
import sys
sys.stdout = sys.stderr
import atexit
import threading
import cherrypy
cherrypy.config.update({'environment': 'embedded'})
cherrypy.engine.start()
atexit.register(cherrypy.engine.stop)
class App_alpha():
@cherrypy.expose
def index(self, * arg_pos, ** arg_nam):
return 'class App_alpha()' + str(arg_pos) + str(arg_nam)
class App_beta():
@cherrypy.expose
def index(self, * arg_pos, ** arg_nam):
return 'class App_beta()' + str(arg_pos) + str(arg_nam)
application = cherrypy.Application(App_alpha(), script_name='/alpha', config=None)
application = cherrypy.Application(App_beta(), script_name='/beta', config=None)
I would like to access the App_alpha() class from yoochan.pythonanywhere.com/alpha/index and the App_beta() class from yoochan.pythonanywhere.com/beta/index.
This, obviously does not behave as expected.
/beta/index works, /alpha/index returns a weird 404 Not Found The path '/betaa/index' was not found. /betaa ?