python - Navigate to new page hosted on bokeh server from within bokeh app -
so i'm writing application running on bokeh server, , having difficulty navigating between different pages being hosted. let's have simple class loads single button:
class navigatewithbutton(hbox): extra_generated_classes = [["navigatewithbutton", "navigatewithbutton", "hbox"]] mybutton= instance(button) inputs = instance(vboxform) @classmethod def create(cls): obj = cls() obj.mybutton = button( label="go" ) obj.inputs = vboxform( children=[ obj.login_button ] ) obj.children.append(obj.inputs) return obj def setup_events(self): super(navigatewithbutton, self).setup_events() if not self.mybutton: return self.mybutton.on_click(self.navigate) def navigate(self, *args): ################################################################### ### want redirect 'http://localhost:5006/other_app' here! ### ################################################################### and further down have, expected:
@bokeh_app.route("/navigate/") @object_page("navigate") def navigate_button_test(): nav = navigatewithbutton.create() return nav along route addtional app i've created within same script:
@bokeh_app.route("/other_app/") @object_page("other_app") def some_other_app(): app = otherapp.create() return app running code can (obviously) navigate between 2 applications typing in address, , both work beautifully, cannot life of me find example of programmatically navigating between 2 pages. i'm answer simple , must overlooking obvious, if tell me precisely being ridiculous or if i'm barking waaay wrong tree i'd extremely appreciative!!
and please bear in mind: i'm there better ways of doing this, i'm tasked finishing inherited code , i'd try , find solution before having rebuild scratch
Comments
Post a Comment