无法识别的旗帜:' - 分机'在python manage.py shell_plus --notebook上

时间:2015-04-14 16:12:15

标签: python django ipython ipython-notebook django-shell

我有一个Django项目,使用在Mac OS X 10.10和python 2.7上运行的Django 1.6.10。我用dip将django_extensions和ipython [notebook]安装到我的virtualenv中:

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

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

1 个答案:

答案 0 :(得分:2)

这已在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

或者在命令行sans requirements.txt:

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