5

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?

Mikko Ohtamaa
  • 82,057
  • 50
  • 264
  • 435

2 Answers2

1

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.

Community
  • 1
  • 1
Skitz
  • 1,226
  • 1
  • 9
  • 5
1

A little late to the game, but I managed to save the notebooks in a different location + auto importing Django settings.

I start my notebooks with:

PYTHONPATH=/path/to/project/root DJANGO_SETTINGS_MODULE=settings python manage.py --notebook --no-browser

The PYTHONPATH enables finding the correct modules of my project and all shell_plus imports work automatically like a charm.

P.S.

As I am running this command executed from my host in my vagrant box --no-browser prevents opening w3m ^^