Python Django项目可以';不要部署到Heroku
我正在尝试部署Django项目。 首先,我得到这个错误:Python Django项目可以';不要部署到Heroku,python,django,heroku,Python,Django,Heroku,我正在尝试部署Django项目。 首先,我得到这个错误: Counting objects: 74, done. Delta compression using up to 2 threads. Compressing objects: 100% (65/65), done. Writing objects: 100% (74/74), 25.74 KiB | 0 bytes/s, done. Total 74 (delta 24), reused 0 (delta 0) remote: Com
Counting objects: 74, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (65/65), done.
Writing objects: 100% (74/74), 25.74 KiB | 0 bytes/s, done.
Total 74 (delta 24), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Failed to detect app matching https://codon-
buildpacks.s3.amazonaws.com/buildpacks/heroku/python.tgz buildpack
remote: More info:
https://devcenter.heroku.com/articles/buildpacks#detection-failure
remote:
remote: ! Push failed
remote: Verifying deploy...
remote:
remote: ! Push rejected to nicoplus.
remote:
To https://git.heroku.com/nicoplus.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/nicoplus.git'
然后,我设置构建包:
heroku buildpacks:set heroku/python
heroku构建包:设置heroku/python
但是,它仍然会抛出一个错误:
remote: -----> Failed to detect app matching https://codon-buildpacks.s3.amazonaws.com/buildpacks/heroku/python.tgz buildpack
远程:-->未能检测到与buildpack匹配的应用程序
那么,这个问题有什么解决办法吗
PS:python是2.7.12通过Heroku查看,我发现: “有许多附加的、不受支持的运行时可用。但是,我们只支持使用Python 3.6.1和2.7.13。”
我的猜测是,使用2.7.12是一种浪费 你有requirements.txt文件吗?(并添加到您的git存储库?)我打赌这就是Python buildpack的关键点……Thx对于上面的评论,我在我的存储库中添加了一个错误的'requirement.txt',Thx以获得您的帮助,但Python 2.7.12仍然可以工作。我犯了一个愚蠢的错误,把requirements.txt写成requirement.txt。哈哈~