django-extensions / django-extensions

This is a repository for collecting global custom management extensions for the Django Framework.
https://django-extensions.readthedocs.io
MIT License
6.57k stars 1.16k forks source link

jupyter notebook shell_plus how to show autoload messages #1330

Open wyattbiker opened 5 years ago

wyattbiker commented 5 years ago

Hi, I start Jupyter Notebook as follows:

$ ./manage.py shell_plus --notebook

This launches Jupyter and I select Django Shell-Plus to start new notebook. However I do not see the import messages like you would have using shell_plus --ipython. Any idea where they would be hiding?

Thanks!

trbs commented 5 years ago

Jupyter notebooks work slightly different from most “Shells”.

Think those are not printed because the notebook gets a “Django kernel” which does the loading before the notebook in the interface is shown.

(This is from the top of my head so might not be 100% accurate :-) )

That said Jupyter has gone a long way since the initial ipython notebook implementation. So I’m sure our ‘shell_plus —notebook’ code can be improved.