Issue: I would like to use JupyterDash and do view my app with mode='inline'. However this results in an error or empty field in the notebook.
Root cause: While possible to use this feature there are a number of additional steps here since the workspace is already running behind a proxy and thus JupyterDash will try to display your app results on what is unreachable address for your browser.
Solution: To overcome this you will need to make a few changes to your code and also install jupyter Server proxy.
First you will have to select your environment and add the jupter server proxy. Detailed steps can be found here .
Once this is complete you will have to add this to your code:
user = os.environ.get("DOMINO_PROJECT_OWNER")
project = os.environ.get("DOMINO_PROJECT_NAME")
runid = os.environ.get("DOMINO_RUN_ID")
runurl = '/' + user + '/' + project + '/notebookSession/'+ runid + '/' + 'proxy/8050/'
app = JupyterDash(__name__,routes_pathname_prefix='/', requests_pathname_prefix=runurl,
server_url="https://emeaplay8959.support-team-sandbox.domino.tech/")
Note that we are using the port that we will run our app on at the end of the 'runurl' definition.
This port will have to be unused and you might want to change it in case you would like to re-run your code.
And starting the app:
app.run_server(port=8050, host='0.0.0.0', mode='inline', debug=True)
Note: here we can set the port for the app which should match the 'runurl'
After running your code you will be able to see the results of the app inline in the notebook:
Please find the attached ipynb file with the example code used in this article.
Comments
0 comments
Please sign in to leave a comment.