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.

1
  • 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. Commented Apr 22, 2014 at 17:04

2 Answers 2

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.

Sign up to request clarification or add additional context in comments.

1 Comment

This fixed it, you're the bestest!
1

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

2 Comments

Can you explain a little bit more ? (Flagged as low quality by SO)
Added link to the Django documentation, hope it will fulfil your requirements.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.