plotly / plotly/dash

Better documentation for using with Binder/JupyterHub

Open
#1,057 2 comments 0 reactions 1 assignee View on GitHub

@LiamConnors is already working on this.

Since Jul 17, 2024.

feature P3
Dominant language
Python
Stars
24.4k
Forks
2.3k
Avg merge
2d 7h
Merged PRs (30d)
13

Description

I write tutorials and do lots of live teaching and gravitate mostly to using Jupyter Notebooks, which allow for text and code to be integrated together in one. Using dash on a local instance of Jupyter is essentially no different than using it from a normal .py file.

But, when teaching to people that have no local jupyter instance or don't even have python installed, I've turned to Binder which relies on JupyterHub.

It took some searching, but I found some github issues and forum posts that informed me I had to set requests_pathname_prefix of the config dictionary like this.

port = 9999
base_prefix = '{}proxy/{}/'.format(os.environ['JUPYTERHUB_SERVICE_PREFIX'], port)
url = 'https://hub.gke.mybinder.org{}'.format(base_prefix)
app.config.update({'requests_pathname_prefix': base_prefix})
app = dash.Dash()
app.run_server(host='0.0.0.0', port=port)

Would be great if this was officially documented somewhere. Thanks and this is a great product. I'm doing a meetup on it in Houston on Jan 2 (apologies if this is self promotion, so no link provided).

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.