Running django_extensions' iPython Notebook from a Vagrant Virtual Machine
Forward the port. In the
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| ... config.vm.network "forwarded_port", guest: 8888, host: 8888 ...
Bring up the virtual machine and shell into it. Install the requirements (this is a little picky, django_extensions wants to import
from IPython.html.notebookapp import NotebookAppwhich is deprecated after iPython 3):
$ pip install django-extensions==1.5.9 ipython==3.2.1 pyzmq>=13 jsonschema==2.5.1 terminado==0.5
'django_extensions', to the list of
INSTALLED_APPS in the Django project.
ipython_config.py file to the root of the project (analogous to the
$ vim ipython_config.py
Edit that to run the server on
0.0.0.0:8888 and disable the attempt to launch a browser which won't be available in the virtual machine:
# ipython_config.py c = get_config() # Allow all IP addresses to use the service and run it on port 8888. c.NotebookApp.ip = '0.0.0.0' c.NotebookApp.port = 8888 # Don't load the browser on startup. c.NotebookApp.open_browser = False
django-extensions can run it:
$ ./manage.py shell_plus --notebook
And, back on the host, the iPython notebook will be accessible in a Web browser at