Django django-admin.py command problem
I'm new to Python and Django. In fact, I'm new to web framework too. I'm using Windows 7 OS and have install开发者_开发技巧ed Django.
I knew Django has been installed successfully. When I go to tutorials, this command, "django-admin.py startproject appproject" always suggested to be run before starting the project.
However, when I run this command, django-admin.py was not recognized as keyword. Can anyone please help me to see what's wrong here?
On windows python scripts get installed to C:\Python27\Scripts (by default for Python2.7). However the python installer does not automatically Add this location to your PATH. What you need to do is either replace any call to django-admin.py with C:\Python27\Scripts\django-admin.py, or add it to your path. You can do that by:
- Open your Start Menu and Locate My Computer, Right Click on it and choose Properties
- On the left hand side select "Advanced System Settings".
- Next click on the "Environment Variables" button.
- Look in the bottom scroll box until you find one named PATH. Select this and hit Edit.
- To the end of the current value, append ";C\Python27\Scripts".
- Close/Save everything, including your cmd.exe prompt. When you reopen it C:\Python27\Scripts should be on your path, and
django-admin.py
should work.
精彩评论