http://djangobook.py3k.cn/2.0/chapter02/
按上述链接的要求在windows 7下安装了python-2.7a1.msi、Django-1.5.1.tar.gz,一路顺利。
在cmd命令行下执行django-admin.py startproject mysite命令时,提示如下错误:
G:\03.worktools\Django\Diango-1.5.1-demo>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
runfcgi
runserver
shell
sql
sqlall
sqlclear
sqlcustom
sqlflush
sqlindexes
sqlinitialdata
sqlsequencereset
startapp
startproject
syncdb
test
testserver
validate
没有具体深究原因,找到解决方案如下,把C:\Python27\Scripts\django-admin.py文件copy到G:\03.worktools\Django\Diango-1.5.1-demo\目录,然后执行如下命令:
python django-admin.py startproject mysite