Django 1.4未知命令:'runserver'

问题描述:

我的python路径中的某些东西必须改变,因为现在我无法运行。

Something in my python path must have changed because now I cannot run the.

python app/manage.py runserver

我得到的输出是

Unknown command: 'runserver'
Type 'manage.py help' for usage.

我已经看过我的环境的PYTHONPATH和PATH变量,但是我不知道为什么它没有运行。

I've looked at my environment's PYTHONPATH and PATH variables, but I can't figure out why its not running.

我找到了我的问题的答案。

I've found the answer to my question.


  • 如果您的设置有错误,manage.py将会将该异常和报告作为该命令不存在。

  • 导致我错误地假设我的python路径或venv环境被弄乱了的路径。

如果你想诊断这个问题,运行...

If you want to diagnose this issue, run...

python app/manage.py help

...它将显示异常。这当然是django shell在告诉我没有找到命令之后推荐的。

... and it will show the exception. This, of course, was what was recommended by the django shell after it had told me that the command was not found.

这显然是Django 1.4中的一个错误。在我看来,无论你运行什么管理命令,都应该报告异常。

This is clearly a bug in Django 1.4. It seems to me, an Exception should be reported regardless of what management command you run.