2

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

Why django is not creating project for me?

Please help !!

Shekhar
  • 11,438
  • 36
  • 130
  • 186

4 Answers4

7

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

stalk
  • 11,934
  • 4
  • 36
  • 58
  • Problem is that when `django-admin.py` is executed through Windows association, then any additional arguments are not transferred to the script, but by some error the "django-admin.py" itself is the only argument seen by the this script. – Morten Zilmer Feb 05 '15 at 09:56
2

Your Django installation is broken. Reinstall.

Ignacio Vazquez-Abrams
  • 776,304
  • 153
  • 1,341
  • 1,358
0

In my case I'm using Canopy on Windows 8 and the only way it worked for me was putting python command also the full path of django-admin.py like this example "c:> python C:\Users\\AppData\Local\Enthought\Canopy\User\Scripts\django-admin.py startproject ".

srodriguex
  • 2,900
  • 3
  • 18
  • 28
0

I have Canopy installed as well. I copied the django-admin file into the directory where I wanted to install my first project. I opened up the python command prompt and typed in:

python django-admin.py startproject mysite

That did the trick for me. Thanks to those who posted because that got me going down the right path.

Jon
  • 1