我在项目的外部目录中。当我尝试 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
切换到myproject
上面的目录并调用heroku run python myproject/manage.py migrate
。
我是一名优秀的程序员,十分优秀!