简体   繁体   English

Heroku - 上传 Django-App 时应用程序与 buildpack https://github.com/heroku/heroku-buildpack-python.git 不兼容

[英]Heroku - App not compatible with buildpack https://github.com/heroku/heroku-buildpack-python.git when uploading a Django-App

I'm new with Heroku and when I try to push my project to Github, I just get the error message:我是 Heroku 的新手,当我尝试将我的项目推送到 Github 时,我只收到错误消息:

App not compatible with buildpack: https://github.com/heroku/heroku-buildpack-python.git应用与 buildpack 不兼容: https://github.com/heroku/heroku-buildpack-python.git

Complete output:完整的 output:

remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Building on the Heroku-20 stack
remote: -----> Using buildpack: https://github.com/heroku/heroku-buildpack-python.git
remote: -----> App not compatible with buildpack: https://github.com/heroku/heroku-buildpack-python.git
remote:        More info: https://devcenter.heroku.com/articles/buildpacks#detection-failure
remote:
remote:  !     Push failed

remote: Verifying deploy...
remote:
remote: !       Push rejected
remote:
To https://git.heroku.com/appname.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/appname.git'

I have a Procfile in my root:我的根目录中有一个 Procfile:

web: gunicorn Food_Blog.wsgi --log-file -

Also I have a requirements.txt and runtime.txt file我还有一个 requirements.txt 和 runtime.txt 文件

runtime.txt:运行时.txt:

python-3.8.1

Anyone an idea how to fix this issue?有人知道如何解决这个问题吗?

Heroku is not detecting your app as python. Heroku 未将您的应用检测为 python。 There might be problem with your requirements.txt file.您的 requirements.txt 文件可能有问题。 You should correct the file and check if there is any kind of typing mistake.您应该更正文件并检查是否有任何类型的输入错误。 You can create one by using this:您可以使用以下方法创建一个:

pip freeze > requirements.txt

You can also try by using one of these python runtime supported by heroku python buildpacks.您也可以尝试使用 heroku python buildpack 支持的 python 运行时之一。

python-3.9.4
python-3.8.9
python-3.7.10
python-3.6.13
python-2.7.18

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM