Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

options "--read-only" Ipython Notebook

I can't run my ipython notebook with the --read-only option. It says :

[NotebookApp] CRITICAL | Unrecognized flag: '--read-only'

It's weird because I've seen several blog mentionning it. I'm running with the 1.1 version of ipython.

Do you know if this option was removed or moved elsewhere?

like image 634
Hub Avatar asked Dec 15 '22 03:12

Hub


1 Answers

There is a super easy way to do what you're trying to do I think though--simply use OS security.

Do this:

  1. When you're ready to deploy to read only, make a special folder for your read-only work, and copy your *.ipynb files into that.

  2. Make the *.ipynb files read-only at the Linux level: chmod 444 *.ipynb.

  3. Run iPython Notebook from that directory. Use a different port so that it won't conflict.

  4. Send the URL to everyone using the URL that has the read-only port.

  5. They can then read it all, even run code, but they will not be able to save changes.

  6. They cannot navigate anywhere outside that directory. E.g. the little home icon only brings them to the folder with your read-only content.

  7. Thus they have full access to the page and its functionality, but cannot mess it up on anyone else. And all you need is a cp and a chmod. Profit!

At least this solved my need. I have my regular port with write authority for all my development, then I copy it over, chmod it, and let people at it. Works just fine for me.

Hope this helps others!

like image 85
James Madison Avatar answered Dec 26 '22 20:12

James Madison