Django 1.8 python:can';t打开文件';manage.py';:[Errno 2]没有这样的文件或目录

Django 1.8 python:can';t打开文件';manage.py';:[Errno 2]没有这样的文件或目录,python,django,Python,Django,我在项目的外部目录中。当我尝试python manage.py runserver时,它可以工作,但是如果我尝试部署代码并执行heroku run python manage.py migrate,它会显示以下错误- (cenv) C:\Users\Machine\cenv\myproject>heroku run python manage.py migrate Running `python manage.py migrate` attached to terminal... up,

我在项目的外部目录中。当我尝试
python manage.py runserver
时,它可以工作,但是如果我尝试部署代码并执行
heroku run python manage.py migrate
,它会显示以下错误-

(cenv) C:\Users\Machine\cenv\myproject>heroku run python manage.py migrate
 Running `python manage.py migrate` attached to terminal... up, run.6848
 python: can't open file 'manage.py': [Errno 2] No such file or directory
但是当我输入
DIR
时,它显示
manage.py
在同一个目录中

   <DIR>          .
   <DIR>          ..
           59 .gitignore
   <DIR>          2015
   <DIR>          feature
          254 manage.py
   <DIR>          media
   <DIR>          myproject
           43 Procfile
          355 requirements.txt
           12 runtime.txt
          723 bytes
          12,963,143,680 bytes free


    (cenv) C:\Users\Machine\cenv\myproject>heroku run ls -al
    Running `ls` attached to terminal... failed
    !    App not found

    (cenv) C:\Users\Machine\cenv\myproject>heroku run pwd
    Running `pwd` attached to terminal... up, run.3539
    /app
。
..
59.基特
2015
特征
254.py
媒体
我的项目
43程序文件
355 requirements.txt
12 runtime.txt
723字节
12963143680字节可用
(cenv)C:\Users\Machine\cenv\myproject>heroku运行ls-al
正在运行附加到终端的“ls”。。。失败
!    找不到应用程序
(cenv)C:\Users\Machine\cenv\myproject>heroku运行pwd
正在运行连接到终端的“pwd”。。。起来,跑
/应用程序

您不能位于Heroku服务器的正确目录中。尝试运行heroku run ls-al查看当前工作目录中的内容

   <DIR>          .
   <DIR>          ..
           59 .gitignore
   <DIR>          2015
   <DIR>          feature
          254 manage.py
   <DIR>          media
   <DIR>          myproject
           43 Procfile
          355 requirements.txt
           12 runtime.txt
          723 bytes
          12,963,143,680 bytes free


    (cenv) C:\Users\Machine\cenv\myproject>heroku run ls -al
    Running `ls` attached to terminal... failed
    !    App not found

    (cenv) C:\Users\Machine\cenv\myproject>heroku run pwd
    Running `pwd` attached to terminal... up, run.3539
    /app
尝试运行pwd查看您的位置

您还可以运行heroku run bash来获得一个bash shell


发布您的前两个命令返回的内容。

切换到上面的目录
myproject
并调用
heroku run python myproject/manage.py migrate
2年后,但对于从谷歌来到这里的任何人,我只是遇到了同样的问题并修复了它。 当heroku返回“.”作为目录中的唯一文件时,表示您尚未更新git存储库

git push heroku master

希望这有帮助

我已经编辑了那部分。它说没有找到
应用程序
。原因可能是什么?只需
让heroku运行ls
并查看它返回什么。另外,请尝试
heroku运行find
heroku运行ls
不会返回任何
heroku运行find
只返回大量值(如数百)的
。我将添加最后两个值/usr/share/doc/libssl-doc/demos/engines/zencod/hw_-zencod_err.c.gz/usr/share/doc/libssl-doc/demos/engines/zencod/hw_-zencod.c.gz1年后,你帮了很多忙!谢谢你