gpt4 book ai didi

python - Django 1.8 python : can't open file 'manage.py' : [Errno 2] No such file or directory

转载 作者:太空宇宙 更新时间:2023-11-03 13:41:03 27 4
gpt4 key购买 nike

我在项目的外部目录中。当我尝试 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

关于python - Django 1.8 python : can't open file 'manage.py' : [Errno 2] No such file or directory,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31033031/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com