开发者

Django's manage.py shell won't indent

I seem to have run into a strange bug or more likely some setting I am unfamiliar with on my system that is not allowing me to tab when I am in Django's shell (python manage.py shell is how I run it).

For obvious reasons this is proving to be annoying since I can't do any loops or conditonals in the shell. If I hit tab it completes all functions that are available to me, like bash does in a terminal. I've tried just using spaces for my indents but I always get an indenta开发者_Python百科tion error.

Does anyone know why this is happening and what I can do to get tab to work in my shell again? (It may be relevant to know that this is on a Ubuntu 9.04 system).

Edit: tab works fine in the regular pythong shell, it's only in django's that it doesn't.

Thanks.


I'm guessing normally when you run python it's invoking something like ipython instead because the normal stock interpreter does not do tab-completion. It should pick up ipython automatically and use it, though. Try firing up a plain python interpreter (just run python at the command line) and running

import IPython

If you can do that, manage.py should use ipython. If not, maybe reinstall ipython as it would appear that the IPython module didn't get properly installed.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜