我使用这个命令:django-admin startproject Hello
启动一个新项目,但我得到以下错误
django-admin : The term 'django-admin' is not recognized as the name
of a cmdlet, function, script file, or operable program. Check the
spelling of the name, or if a path was included, verify that the
path is correct and try again.
At line:1 char:1
+ django-admin startproject Hello
+ ~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (django-admin:String)
[], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
我刚开始使用Django,这太令人沮丧了
2条答案
按热度按时间swvgeqrz1#
看来你没有安装Django。如果你已经安装了它,你应该检查一下你的虚拟环境(venv)是否激活了。查看此文档:https://docs.python.org/pt-br/3/library/venv.html
转到项目目录并尝试以下操作:
然后:
1tuwyuhd2#
创建虚拟环境后,尝试在vscode中安装django
then:检查django的版本