django-admin.py startproject无法在Windows上创建项目。

时间:2016-11-14 22:20:07

标签: django

我在Windows服务器上,当我输入" django-admin.py startproject"时,我收到以下消息。看起来我没有正确使用命令,但它是正确的。我的Django版本是Django 1.10和Pythhon 2.7。

c:\test>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           Raise 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]
    check
    cleanup
    compilemessages
    createcachetable
    dbshell
    diffsettings
    dumpdata
    flush
    inspectdb
    loaddata
    makemessages
    runfcgi
    runserver
    shell
    sql
    sqlall
    sqlclear
    sqlcustom
    sqldropindexes
    sqlflush
    sqlindexes
    sqlinitialdata
    sqlsequencereset
    startapp
    startproject
    syncdb
    test
    testserver
    validate

2 个答案:

答案 0 :(得分:3)

试试这个:

 django-admin startproject projectname

感谢。

答案 1 :(得分:0)

尝试

python djangoadmin.py startproject mysite

或检查this answer