Windows 7中的django路径问题
我的 django-admin.py 路径有问题。它位于我的 python Homes 脚本文件夹中,我也设置了一个 PATH 变量。但它根本不起作用。是因为windows 7吗!?
编辑 当我在该脚本文件夹内时,我可以从命令行使用 django-admin 。但不能从其他任何地方使用 。也就是说,从其他磁盘驱动器。
I am having problems with path, of django-admin.py. It is in my python homes scripts folder, and i have setup a PATH variable too. But it is not working at all. Is it because of windows 7!?
EDIT
I am able to use django-admin from command line when i am inside that scripts folder..but not from anywhere else.. that is, from other disk drives.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我相信您的问题是当您尝试从任意位置运行 django-admin 脚本时无法找到它。如果这是不正确的,请告诉我。将来,您应该尝试提供收到的任何错误消息,以帮助社区为您提供帮助。
你能告诉我们你的 PATH 环境变量吗?如果我没记错的话,右键单击“我的电脑”,转到“属性”,然后在其中一个选项卡上,您应该看到一个包含不同环境变量集的列表框。使用 PATH 变量的内容编辑您的问题。
如果将 python 设置为打开 .py 文件的默认程序,则运行 django-admin.py 脚本应该非常简单
:直接位于 PATH 上的目录内,或者位于包含脚本的目录内。您还可以使用相对路径来访问脚本。
上面假设您当前在命令行中位于
c:\development\django\
中,并且已在>
之后输入文本I believe that your problem is that the django-admin script can not be located when you try to run it from an arbitrary location. Please let me know if that's incorrect. In the future, you should try to provide any error messages that you receive, to help the community help you.
Can you show us your PATH environment variable? If I remember correctly, right click on 'My Computer', go to 'Properties', and on one of the tabs, you should see a list box with different environment variables set. Edit your question with the contents of the PATH variable.
If python is set as the default program for opening up .py files, then running the django-admin.py script should be as simple as:
This will only work if the
django-admin.py
script is located directly inside a directory that is on your PATH, or if you're inside the directory containing the script. You can also use a relative path to get to the script.The above assumes you're currently in
c:\development\django\
at the command line, and have entered the text after>