安装Django后无法打开manage.py

编程入门 行业动态 更新时间:2024-10-26 22:23:12
本文介绍了安装Django后无法打开manage.py的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我在设置Django时遇到问题.

I have a problem in setting up django.

我的情况:我的Windows 8计算机中装有Anaconda Python 2.7.在Anaconda命令提示符窗口中,键入:pip install django.成功了.

My situation: I have Anaconda Python 2.7 in my Windows 8 computer. On the Anaconda command prompt window, I type: pip install django. This is successful.

然后我创建一个名为"newproject"的文件夹.在命令提示符下,我转到文件夹"newproject".然后django-admin.py startproject newproject.成功了.

Then I create a folder named "newproject". On the command prompt I went to the folder "newproject". Then django-admin.py startproject newproject. This is successful.

然后我运行python manage.py runserver.它告诉我

"...can't open file 'manage.py': [Errno 2] No such file or directory"

我在网上检查了udemy django安装指南和其他指南.我什至设置了一个虚拟环境.但是主要的问题始终是:can't open file 'manage.py'

I checked out udemy django installation guide and other guides on the net. I have even set up a virtual environment. But the main problem is always: can't open file 'manage.py'

推荐答案

您不在正确的目录中...在您描述的情况下,您应该具有:

You're not in the proper directory...In the case you described, you should have:

  • mkdir newproject(不确定为什么要这样做...但我们将继续进行下去)
  • cd newproject
  • django-admin.py startproject newproject
  • cd newproject←您所做的工作中缺少关键的一环.您需要切换到 manage.py 所在的目录.切换到目录后,在命令提示符下使用ls进行验证.
  • python manage.py runserver
  • mkdir newproject (not sure why you're doing this...but we'll continue with it)
  • cd newproject
  • django-admin.py startproject newproject
  • cd newproject ← A key missing part from what you did. You need to change into the directory where manage.py resides. Verify it by using ls at the command prompt after switching into the directory.
  • python manage.py runserver
  • 如果需要,经常使用ls仔细检查您在目录树中的位置.

    Use ls often, if you need, to double check where you are in the directory tree.

    更多推荐

    安装Django后无法打开manage.py

    本文发布于:2023-10-22 22:18:25,感谢您对本站的认可!
    本文链接:https://www.elefans.com/category/jswz/34/1518888.html
    版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
    本文标签:无法打开   Django   py   manage

    发布评论

    评论列表 (有 0 条评论)
    草根站长

    >www.elefans.com

    编程频道|电子爱好者 - 技术资讯及电子产品介绍!