Windows error when installing Django
After all I started learning Django. Just installed it. The first method to check if it got installed correctly is to write at the python shell:
If this statement runs without reporting any errors, then be happy, your installation is complete.
The next step is to create a project. On windows7 (I am using), when I wrote the command on commandline:
django-admin.py startproject testproj ## should create a directory named testproj
I got the most frustrating error:
C:\Users\Ayush\Documents\Django>django-admin.py startproject testproject 'django-admin.py' is not recognized as an internal or external command, operable program or batch file.
I was confused. I just imported django on my shell and it worked fine!. Then I started on the quest of this “django-admin.py”. I searched the site-packages directory of python (didn’t look deep the first time), and didn’t find anything.
Then I searched a bit on the net and someone was giving an advice to put django-admin.py in the scripts folder of python. Since I installing a very new version (1.3), I checked the Scripts folder and found it there. 🙂
So, anyone finding similar error, just redirect yourself to the Scripts folder (
C:\Python27\Scripts\testproj) and execute the command there:
django-admin.py startproject testproject
Though this is not the place we wanted to create our test project directory, but something is better than nothing.. 🙂
An addition: Some people might not be able to start projects with the aforementioned command. Instead try this:
>python.exe django-admin.py startproject testproject
My friend on WinXP solved his problem with this command.