Ipython无法运行`manage.py`

时间:2018-05-24 09:14:50

标签: django

当我尝试发出使用gridWidth运行Django shell的命令时,它会提示输入以获取帮助:

ipython

但是,我知道$ ipython manage.py shell Type 'manage.py help <subcommand>' for help on a specific subcommand. Available subcommands: [auth] changepassword createsuperuser [contenttypes] remove_stale_contenttypes 能够运行模块

ipython

cat expriment.py print("run it with ipython") ipython experiment.py run it with ipython 无法运行ipython的原因是什么?

2 个答案:

答案 0 :(得分:0)

您尚未在ipython安装virtualenv

将其安装在virtualenv

使用:

python manage.py shell -i ipython

答案 1 :(得分:0)

我不确切地知道为什么它没有像问题中给出的那样运行,但我可以说django-extensions包将允许你使用ipython shell。它还添加了许多其他非常有用的东西,特别是在浏览器中进行性能分析和带有交互式回溯的调试器。

尝试:

pip install django-extensions
... add to config per instructions linked below ...
python manage.py shell_plus —ipython

在此处阅读更多http://django-extensions.readthedocs.io/en/latest/index.html

相关问题