New Install - django-admin.py ... just gives contest/options but doesn't run?

12 views
Skip to first unread message

Robert G

unread,
May 9, 2012, 1:34:41 PM5/9/12
to Django users
When I type

d:\myproj>django-admin.py startproject mysite
or
d:\myproj>django-admin.py test

or any of the subcommands, I get this message:

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
runserver
shell
sql
sqlall
sqlclear
sqlcustom
sqlflush
sqlindexes
sqlinitialdata
sqlreset
sqlsequencereset
startapp
startproject
syncdb
test
testserver
...

This is a fresh install of Python2.7 and Django 1.4.

in Python, I can import django & print(django.getversion()) with no
problem so I assume it is installed correctly.

I've added D:\Python27;D:\Python27\Scripts; to my PATH environmental
variables (Using Windows 7).

I did have one issue when I first tried to install Django it popped up
a window asking what program to use, I manually selected the Python
application from the list and the django installation worked.

I can't seem to find much about this error online - any suggestions?

Daniel Roseman

unread,
May 9, 2012, 4:59:43 PM5/9/12
to django...@googlegroups.com
On Wednesday, 9 May 2012 18:34:41 UTC+1, Robert G wrote: 

I can't seem to find much about this error online - any suggestions?

On the contrary, this is very much a FAQ. Your Windows installation is set to run scripts against Python, but without passing any arguments.

Easiest way to fix it is to explicitly use `python django-admin.py startproject mysite` instead. 
--
DR.

Robert G

unread,
May 9, 2012, 5:46:29 PM5/9/12
to Django users
Awesome, thought I tried this but apparently not.

I had to use d:\myproj>python d:/Python27/Scripts/django-admin.py
startproject mysite to make it work, but it worked so yay!

On with the tutoral I go!

Jani Tiainen

unread,
May 10, 2012, 2:41:01 AM5/10/12
to django...@googlegroups.com
I also could recommend really to use virtualenv - saves nerves and time.
I wrote short blog entry a while ago about setting "sane" python/django
environment specially in win7:
http://djangonautlostinspace.wordpress.com/2012/04/16/django-and-windows/

--
Jani Tiainen

- Well planned is half done and a half done has been sufficient before...
Reply all
Reply to author
Forward
0 new messages