gpt4 book ai didi

django-admin.py startproject mysite 命令不起作用

转载 作者:行者123 更新时间:2023-12-02 06:39:33 25 4
gpt4 key购买 nike

我正在尝试使用 django 创建第一个项目,但在第一步本身就卡住了。每当我给出 django-admin.py startproject mysite command not working 命令时,什么都没有发生,并且帮助相关信息出现在命令提示符下。我已经设置了 PYTHON_HOMEPATH 变量设置正确。我正在使用 python 2.7。

我的命令提示符如下所示:

C:\Shekhar\djangoWorld>c:\Python27\Scripts\django-admin.py startproject mysite
Usage: django-admin.py subcommand [options] [args]

Options:
-v VERBOSITY, --verbosity=VERBOSITY
Verbosity level; 0=minimal output, 1=normal output,
2=verbose output, 3=very verbose output
--settings=SETTINGS The Python path to a settings module, e.g.
"myproject.settings.main". If this isn't provided, the
DJANGO_SETTINGS_MODULE environment variable will be
used.
--pythonpath=PYTHONPATH
A directory to add to the Python path, e.g.
"/home/djangoprojects/myproject".
--traceback Print traceback on exception
--version show program's version number and exit
-h, --help show this help message and exit

Type 'django-admin.py help <subcommand>' for help on a specific subcommand.

Available subcommands:

[django]
cleanup
compilemessages
createcachetable
dbshell
diffsettings
dumpdata
flush
inspectdb
loaddata
makemessages
reset
runfcgi

为什么 django 不为我创建项目?

请帮忙!!

最佳答案

在 django-admin.py 之前添加“python”(或添加 python.exe 的完整路径)。

C:\Shekhar\djangoWorldpython c:\Python27\Scripts\django-admin.py startproject mysite

关于django-admin.py startproject mysite 命令不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10731873/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com