django-admin.py startproject mysite命令不工作 [英] django-admin.py startproject mysite command not working
问题描述
我正在尝试使用django创建第一个项目,但是坚持在第一步。每当我提供 django-admin.py startproject mysite命令不工作
命令时,没有任何反应,帮助相关信息出现在命令提示符下。我设置了 PYTHON_HOME
, PATH
变量设置正确。我正在使用python 2.7。
I am trying to create very first project using django but stuck at very first step itself. Whenever I give django-admin.py startproject mysite command not working
command, nothing happens and help related information comes up on command prompt. I have set PYTHON_HOME
, PATH
variables set correctly. I am using python 2.7.
我的命令提示符如下所示:
My command prompt looks as follows :
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不是为我创建项目?
Why django is not creating project for me?
请帮忙!
推荐答案
在django-admin.py之前添加python(或添加python.exe的完整路径)。
Add 'python' before django-admin.py (or add full path to python.exe).
C:\Shekhar\djangoWorld> python
c:\Python27\Scripts\django-admin.py startproject mysite
C:\Shekhar\djangoWorld>python
c:\Python27\Scripts\django-admin.py startproject mysite
这篇关于django-admin.py startproject mysite命令不工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!