添加“django-admin.py” Windows 7上的命令行路径 [英] Add "django-admin.py" path to command line on Windows 7
本文介绍了添加“django-admin.py” Windows 7上的命令行路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我一直在尝试在Windows 7上将 django-admin.py
路径添加到命令行。
我试图这样做:
C:\> set django-admin.py = C: \Python27\Scripts\django-admin.py
但 cmd
告诉我:
'django-admin.py'未被识别为内部或外部命令。
那么如何添加 django-admin.py
我需要它,因为以后我会这样做:
<$> p $ p>
C:\Users\Michael\Desktop\mysite> django-admin.py startproject mysite
感谢。
解决方案
尝试以下命令。
设置路径=%path%; c:\python27\scripts
PATH
仅在运行上述命令的cmd.exe中设置。
UPDATE
永久设置PATH:
- 在桌面上右键点击我的电脑。
- 点击左侧的高级系统设置
- 点击环境变量。
- 添加或更新
PATH
变量:
- 如果不存在,请创建一个,并将值设置为
C:\python27\scripts
- 如果存在,将
; C:\Python27\scripts
添加到现有值。
- 如果不存在,请创建一个,并将值设置为
- 重新启动cmd.exe。 (已启动的cmd.exe的PATH不会改变)
I've been trying to add the django-admin.py
path to command line on Windows 7.
I have tried to do it this way:
C:\>set django-admin.py = C:\Python27\Scripts\django-admin.py
But cmd
told me that:
'django-admin.py' is not recognized as an internal or external command.
So how can I add django-admin.py
path to command line on Windows 7?
I need it because later I'm doing this:
C:\Users\Michael\Desktop\mysite>django-admin.py startproject mysite
Thanks.
解决方案
Try following command.
set path=%path%;c:\python27\scripts
PATH
is set only for the cmd.exe in which you run the above command.
UPDATE
To permanently set PATH:
- Right click My computer in the desktop.
- Click Advanced System Settings on the left.
- Click Environmental Variable.
- Add or Update
PATH
variable:- If it does not exist, create one, and set value as
C:\python27\scripts
- If it exist, append
;C:\Python27\scripts
to existing value.
- If it does not exist, create one, and set value as
- Restart cmd.exe. (PATH will not change for already launched cmd.exe)
这篇关于添加“django-admin.py” Windows 7上的命令行路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文