无法识别的标志:python manage.py shell_plus --notebook 上的“--ext”

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

我有一个使用 Django 1.6.10 运行ning 在 Mac OS X 10.10 和 python 2.7 上的 Django 项目。我使用 pip:

在我的 virtualenv 中安装了 django_extensions 和 ipython[notebook]
django-extensions==1.5.0
ipython==3.1.0

但是,当我尝试 运行 django ipython 笔记本时:

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

ipython 笔记本崩溃:

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

这被记录在这里:https://opensourcehacker.com/2014/08/13/turbocharge-your-python-prompt-and-django-shell-with-ipython-notebook/#Django_integration

我不确定这次崩溃的起因。有什么想法吗?

这已在 github 上的 django-extensions 的主分支中修复。要使用此版本的 django-extensions:

在你的requirements.txt中:

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

那么...

pip install -r requirements.txt

或者在命令行中没有 requirements.txt:

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