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:
$ pip install django-extensions ipython pyzmq jsonschema terminado jupyter
'django_extensions', to the list of
INSTALLED_APPS in the Django project's settings file.
Add a list of configuration options to the Django project's settings file 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:
NOTEBOOK_ARGUMENTS = [ '--ip', '0.0.0.0', '--port', '8888', '--no-browser' ]
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
- February 23, 2017 — Updated to work with the latest versions of the modules noting the use of the
jupytermodule to get around the
ImportError: No module named notebookapperror when attempting
from IPython.html.notebookapp import NotebookAppas well as the replacement of configuration within
ipython_config.pywith configuration within the project settings file.