【问题标题】:django-admin.py startproject can't create project on Windows.django-admin.py startproject 无法在 Windows 上创建项目。
【发布时间】:2016-11-14 22:20:06
【问题描述】:

我在 Windows 服务器上,当我输入“django-admin.py startproject”时,我收到以下消息。看起来我没有正确使用该命令,但它是正确的。我的 Django 版本是 Django 1.10 和 Python 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

【问题讨论】:

  • 你是使用虚拟环境还是全局安装了Django?

标签: django


【解决方案1】:

试试这个:

 django-admin startproject projectname

谢谢。

【讨论】:

    【解决方案2】:

    试试

    python djangoadmin.py startproject mysite
    

    或查看this answer。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-07-20
      • 2023-03-26
      • 2010-11-28
      • 2011-04-10
      • 2011-06-14
      相关资源
      最近更新 更多