1

我安装了 ipython,我想用 manage.py shell 运行一个普通的 python 解释器。

所以我尝试,

python2.5 manage.py shell --plain

这给了我一个错误,以及表明 --plain 已传递给 ipython 的文本

所以我读了,http://docs.djangoproject.com/en/dev/ref/django-admin/

建议

django-admin.py shell --plain

这给了我

Error: Settings cannot be imported, because environment variable DJANGO_SETTINGS_MODULE is undefined.

这似乎是正确的做法。

我在这里想念什么?[Ubuntu Jaunty, django.VERSION = (1, 2, 0, 'alpha', 0), python 2.5 和 2.6]

4

2 回答 2

1

如果您想使用 python 的解释器而不是 iPython 的原因是因为您需要粘贴 doc 测试,您可以尝试输入

%doctest_mode

在 ipython 控制台中

In [1]: %doctest_mode
*** Pasting of code with ">>>" or "..." has been enabled.
Exception reporting mode: Plain
Doctest mode is: ON
>>> 
于 2009-08-19T10:53:32.307 回答
0

链接到解释 bpython 相同内容的博客文章

于 2009-08-18T18:11:33.137 回答