def login_proc(self, username = None, password = None):
if username and password:
# Greet the user!
#return cherrypy.tree.mount_points['/'].data_entry.index()
raise cherrypy.InternalRedirect('/data_entry')
else:
return 'Please enter username/password <a href="./">here</
a>.'
login_proc.exposed=True
Well, you really don't want to do that. But if you did, it would be something like this in CherryPy 3:
return cherrypy.tree.apps['/'].root.data_entry.index()
What you have looks like it should work in CP 2.
But you don't want to do that anyway, because your boss is going to come in tomorrow and say, "let's move the whole app from '/' to '/department/apps'." And you'll have to rewrite your source code. :/ A more portable solution (in CP 3) would be:
return cherrypy.request.app.root.data_entry.index()
If for some odd reason you still want to know the actual mount point of the current app, that's available in cherrypy.request.script_name (again, in CP 3).
Robert Brewer
System Architect
Amor Ministries
fuma...@amor.org