Help with Django Installation

2019-08-14 17:43发布

问题:

I'm trying to create my first project by typing in THEFULLPATH\django-admin.py startproject mysite but its not working. No 'mysite' directory created in my current directory. Instead it gives me a list of commands that is available with django-admin.py. See the below screenshot for more details.

回答1:

You need to specifically run the script with python, so:

python django-admin.py startproject

I'm not sure why it behaves like this, and it sure is annoying..



回答2:

The problem (as your other question states), is documented here. You need to unset the environment variable DJANGO_SETTINGS_MODULE.

You can do this by typing:

set DJANGO_SETTINGS_MODULE=

at a DOS command prompt.