当我这样做时没有任何反应:python manage.py 命令

2022-01-25 00:00:00 python django django-admin

问题描述

我是 django 新手,目前正在学习主要教程.即使它早些时候工作,当我执行 python manage.py runserver 或 python manage.py -h 或与任何其他命令时,shell 不会输出任何内容.想知道我做错了什么.

I'm new to django and currently going through the main tutorial. Even though it was working earlier, when I do python manage.py runserver OR python manage.py -h OR with any other command, the shell doesn't output anything. Wondering what I'm doing wrong.


解决方案

首先,通过在shell中输入python"来检查python是否已完全安装.

First, check if python is fully installed by typing "python" in a shell.

那么你应该在你的 django 项目中尝试 python manage.py runserver.如果您没有任何 django 项目,请尝试通过键入 django-admin.py startproject mysite 来创建一个.如果您的 shell 中没有显示任何内容,那么您一定是安装了错误的 Django.

Then you should try python manage.py runserver inside your django project. If you don't have any django project, try creating one by typing django-admin.py startproject mysite. If nothing is displayed in your shell, you must have installed Django the wrong way.

请参阅 https://docs.djangoproject.com/en 的 Django 文档/1.4/intro/install/

相关文章