Running django_extensions' iPython Notebook from a Vagrant Virtual Machine

Forward the port. In the Vagrantfile:

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
  ... "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

Add 'django_extensions', to the list of INSTALLED_APPS in the Django project.

Add an file to the root of the project (analogous to the file:

$ vim

Edit that to run the server on and disable the attempt to launch a browser which won't be available in the virtual machine:


c = get_config()

# Allow all IP addresses to use the service and run it on port 8888.
c.NotebookApp.ip = ''
c.NotebookApp.port = 8888

# Don't load the browser on startup.
c.NotebookApp.open_browser = False

Now django-extensions can run it:

$ ./ shell_plus --notebook

And, back on the host, the iPython notebook will be accessible in a Web browser at http://localhost:8888.