Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Setting IPython Notebook save directory when using through django_extensions

I am using IPython Notebook through django_extensions:

     python manage.py shell_plus --notebook

This saves the Notebook files to the current folder (Django project folder). How can I change the save location for .ipynb files?

like image 864
Mikko Ohtamaa Avatar asked Nov 02 '22 02:11

Mikko Ohtamaa


1 Answers

You can change the directories where files are stored and read from using these parameters in ~/.ipython/profile_projectname/ipython_notebook_config.py, where projectname is your Django project.

c.NotebookManager.notebook_dir = u'/path/to/files'

c.FileNotebookManager.notebook_dir = u'/path/to/files'

This seems to ruin the import path to django however. I've been trying to play around with syspath to get this right via adding startup scripts in the startup directory, but have not found a solution that works yet. If you find a solution, let me know, because I'd like to have my notebook files outside of my project root directory as well.

like image 183
Skitz Avatar answered Nov 15 '22 15:11

Skitz