Search code examples
pythondjangoipythonjupyter-notebookdjango-shell

Unrecognized flag: '--ext' on python manage.py shell_plus --notebook


I have a Django project using Django 1.6.10 running on Mac OS X 10.10 and python 2.7. I have django_extensions and ipython[notebook] installed into my virtualenv using pip:

django-extensions==1.5.0
ipython==3.1.0

However, when I try to run the django ipython notebook:

12:02 $ python manage.py shell_plus --notebook

ipython notebook crashes with:

[C 12:02:37.652 NotebookApp] Bad config encountered during initialization:
[C 12:02:37.652 NotebookApp] Unrecognized flag: '--ext'

This was documented here: https://opensourcehacker.com/2014/08/13/turbocharge-your-python-prompt-and-django-shell-with-ipython-notebook/#Django_integration

I'm not sure where this crash is originating. Any ideas?


Solution

  • This has been fixed in the master branch of django-extensions on github. To use this version of django-extensions:

    In your requirements.txt:

    # Django Extensions
    -e git+git://github.com/django-extensions/django-extensions.git#egg=django-extensions
    

    Then...

    pip install -r requirements.txt
    

    Or at the command line sans requirements.txt:

    pip install -e git+git://github.com/django-extensions/django-extensions.git#egg=django-extensions