Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the way to set ipython notebook server parameters when running notebook with django-extensions?

I am using the following command to run an ipython notebook server with django:

./manage.py shell_plus --notebook

The server functions as expected. However, I would like to set the port and not launch a browser when starting the server.

If I were running an IPython notebook server without django I successfully use the following:

ipython notebook --port=9999 --no-browser

I checked the documentation here and tried setting the options using

IPYTHON_ARGUMENTS = [
    '--ext', 'django_extensions.management.notebook_extension',
    '--port=9999',
    '--no-browser,
]

These arguments are loaded after the server has already started and do not change the notebook server settings from what I can gather.

How can I set the notebook server settings when launching the notebook server with django using

    ./manage.py shell_plus --notebook

?

Thank you in advance.

like image 464
dmmfll Avatar asked Apr 14 '15 15:04

dmmfll


People also ask

Does Jupyter notebook support Django?

To explore your Django models in Jupyter Notebook, you can use the following setup. Then, I usually add DJANGO_ALLOW_ASYNC_UNSAFE to debug locally. Not recommended on production databases.

What is Django extension?

Django Extensions is a collection of custom extensions for the Django Framework. These include management commands, additional database fields, admin extensions and much more.


1 Answers

Running the latest version of IPython (4.2.0), I had to add this to settings.py:

NOTEBOOK_ARGUMENTS = [
    # exposes IP and port
    '--ip=0.0.0.0',
    '--port=8888',
    # disables the browser
    '--no-browser',
]
like image 54
Diego Ponciano Avatar answered Sep 22 '22 02:09

Diego Ponciano