[IPython-dev] Customize IPython tree / dashboard with machine name

Matthias Bussonnier bussonniermatthias at gmail.com
Thu Aug 6 12:49:25 EDT 2015


So, 


Have look at this repo : 

https://github.com/jupyter/docker-demo-images <https://github.com/jupyter/docker-demo-images>


you see in particular that you can extend the page template: 

https://github.com/jupyter/docker-demo-images/blob/feea0967a3493a7ebe514f53084d84a7c8bfe88c/common/templates/page.html <https://github.com/jupyter/docker-demo-images/blob/feea0967a3493a7ebe514f53084d84a7c8bfe88c/common/templates/page.html>

(only line 1 and 16-20 of interest) that you can put somewhere on your hard drive:

```/path/to/your/templates/page.html

{% extends "templates/page.html" %}

{% block header_buttons %}
  <span id="login_widget">
    <a class="pull-right" style=“...”>YouText</a>
  </span>
{% endblock %}
```

and then extend the template search path as in here:

https://github.com/jupyter/docker-demo-images/blob/feea0967a3493a7ebe514f53084d84a7c8bfe88c/common/profile_default/ipython_notebook_config.py#L17 <https://github.com/jupyter/docker-demo-images/blob/feea0967a3493a7ebe514f53084d84a7c8bfe88c/common/profile_default/ipython_notebook_config.py#L17>

c.NotebookApp.extra_template_paths = [‘/path/to/your/templates/‘]

You can put text, image, or anything else that will apply to all your pages. 
You can also overwrite other template blocks. 

The JupyterHub case for 1 person many servers is an interesting one. 
I would bring it up as an issue on JupyterHub see if there are some abstractions we can
improve. 

-- 
M



> On Aug 6, 2015, at 09:35, Jon Wilson <jsw at fnal.gov> wrote:
> 
> I run multiple notebook servers because there are several different 
> analysis machines that I use.  One here at A&M that is actually the head 
> node of a cluster, three different machines at Stanford, one or more at 
> Fermilab.  Different data and different computational capabilities are 
> available in different places.  Some machines are available for analysis 
> of data from my current experiment, and some only for data from my 
> previous experiment.  So on and so forth.
> Regards,
> Jon
> 
> On 08/06/2015 11:30 AM, Matthias Bussonnier wrote:
>>> On Aug 6, 2015, at 09:19, G Jones <glenn.caltech at gmail.com> wrote:
>>> 
>>> Hi,
>>> I run ipython notebook servers on several different machines, and then set up ssh tunnels from my personal machine to access the notebook servers in my browser. The trouble is I have so many now that I am forgetting which port number corresponds to which notebook server. So I'd like to add a bit of text to the dashboard that says at least the machine name, and preferably some other identifying info, in case I have two servers running on the same machine. Is there an easy way to do this? I looked at the generate_page_title function in html/tree/handlers.py, but it seems to be hard coded to return either Home or the current directory path. Is there something built in configurable? I'd like to avoid having to do anything specialized as much as possible. I'm running ipython 3.1.0, but could upgrade if this feature is available in a newer version.
>>> 
>> 
>> Out of curiosity, why are you running multiple servers ?
>> 
>> One server should be enough to browse all your hard drive and have access to many kernel ?
>> 
>> If you really need multiple server, it might be possible to host them behind a jupyterHub modified instance so that they are behind a unique port,
>> but at different urls.
>> Would that suit you ?
>> 
> 
> _______________________________________________
> IPython-dev mailing list
> IPython-dev at scipy.org
> http://mail.scipy.org/mailman/listinfo/ipython-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20150806/f368aa7f/attachment.html>


More information about the IPython-dev mailing list