2

When I try to start a new Django project by typing "django-admin.py startproject my_site" I am getting the following error: "'django-admin.py' is not a recognized as an internal or external command, operable program or batch file"

I am looking for help determining the correct path environment variable for Django on windows 7.

I have python correctly setup/installed. And I really thought Django was installed, presumably based on the command window output, it churned out considerable text, and the folder structure looks correct when I ran the install file.

I am convinced the problem is that my path variables aren't set up correctly. I can only seem to find advice online to add in the Python 2.7 path variable, which I already know works.

The current location of my Django folders is: C:\django And the current location of my Python 2.7 is: C:\Python27 Inside the python/scripts, there are django-admin files, so I swear, I'm not crazy.

Do I need to be inside the Django folder to make this work?

Thank you for any input you can offer.

garnertb
  • 9,454
  • 36
  • 38
Eleanor Zimmermann
  • 414
  • 1
  • 8
  • 26
  • It sounds like you do not have Python installed correctly. It should be installed as the default handler for .py files so that when you type xyz.py, Windows runs python.exe. – jarmod Apr 22 '14 at 17:04

2 Answers2

2

You need to add C:\Python27\Scripts to your PATH environment variable. You should also check this post about making .py files run in windows.

Community
  • 1
  • 1
yorodm
  • 4,359
  • 24
  • 32
1

As per Django documentation, you need to have C:\Python27\Scripts in your path.

Juliusz
  • 2,096
  • 2
  • 27
  • 32