windows django-admin.py startproject 打开记事本,而不是创建一个项目
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/4679311/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
django-admin.py startproject opens notepad, instead of creating a project
提问by Marijus
Hey, so basically when I try to django-admin.py startproject mysite my notepad with django-admin.py file opens up instead of creating a new actual projects. I'm on windows and just yesterday I created the project and everything was fine.
嘿,所以基本上当我尝试 django-admin.py startproject mysite 时,我的带有 django-admin.py 文件的记事本会打开,而不是创建一个新的实际项目。我在 Windows 上,就在昨天我创建了这个项目,一切都很好。
采纳答案by sidhshar
Your python files would be associated to open with notepad. Change the behaviour to open with IDLE/python.
您的 python 文件将与记事本关联以打开。更改行为以使用 IDLE/python 打开。
回答by chefsmart
Instead of django-admin.py startproject mysite
try python django-admin.py startproject mysite
而不是django-admin.py startproject mysite
尝试python django-admin.py startproject mysite
That should work, but...
那应该有效,但是...
...you will need to do something more if you want django-admin.py startproject mysite
to work without adding python
at the start: -
...如果你想django-admin.py startproject mysite
在不添加python
的情况下工作,你需要做更多的事情:-
- right click any python file ending with the extension .py
- click on
properties
- In the
opens with
section, you should be able to seenotepad
. click on thechange
button next to this. - click "browse" and locate your python.exe executable, most probably in c:\pythonxx\ directory then click on "open" then "ok"
- 右键单击以扩展名 .py 结尾的任何 python 文件
- 点击
properties
- 在该
opens with
部分中,您应该能够看到notepad
. 单击change
旁边的按钮。 - 单击“浏览”并找到您的 python.exe 可执行文件,最有可能在 c:\pythonxx\ 目录中,然后单击“打开”然后单击“确定”
That should set you up, or you can always revert back for clarifications.
这应该让您有所准备,或者您可以随时返回以进行澄清。
回答by Rusty
Another method: Instead of using django-admin.py write django-admin
另一种方法:而不是使用 django-admin.py 写 django-admin
django-admin startproject mysite
回答by anand24
When faced with an issue of django-admin.py opening in an editor
当遇到在编辑器中打开 django-admin.py 的问题时
I did this
我做了这个
Select python file and right click and set default open with python console for windows Problem will be solved automatically
选择python文件并右键单击并设置默认打开与windows的python控制台问题将自动解决