开发者

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:

  1. Open your Start Menu and Locate My Computer, Right Click on it and choose Properties
  2. On the left hand side select "Advanced System Settings".
  3. Next click on the "Environment Variables" button.
  4. Look in the bottom scroll box until you find one named PATH. Select this and hit Edit.
  5. To the end of the current value, append ";C\Python27\Scripts".
  6. 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.
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜