简体   繁体   English

在 heroku 上部署时推送被拒绝

[英]Push rejected while deploying on heroku

I am deploying my project with heroku. My Django version number is 3.2.8 and python 3.9.7.我正在使用 heroku 部署我的项目。我的 Django 版本号是 3.2.8 和 python 3.9.7。 It is written on heroku. Heroku supports Python 3.9.7 deployment, but there is an error in my push process.写在heroku上。Heroku支持Python 3.9.7部署,但是我的push过程出现错误。 The version above does not support it.以上版本不支持。 What should I do?我应该怎么办? Thank you for your reply This is my cmd谢谢你的回复这是我的cmd在此处输入图像描述 my requirements.txt我的要求.txt

在此处输入图像描述

I haven't used Heroku but I'm curious if this is a problem related to enforced nomenclature on main branch.我没有使用 Heroku 但我很好奇这是否与主分支上的强制命名相关。

A while back I could not push my first commit to a new and empty Git repository if my push command was "git push origin master", it started working after I changed it to "git push origin main" so I suspect this could be the issue you're facing.前一段时间,如果我的推送命令是“git push origin master”,我无法将我的第一次提交推送到一个新的空 Git 存储库,它在我将其更改为“git push origin main”后开始工作,所以我怀疑这可能是你面临的问题。

Sorry I couldn't ask you before I posted this answer if this is your first push, I do not have enough points to post a comment.抱歉,如果这是您的第一次推送,我在发布此答案之前无法问您,我没有足够的积分来发表评论。

This is due to that Heroku has specific python runtimes.这是因为 Heroku 具有特定的 python 运行时。
Visit the link to know: Heroku Supported Runtimes Python访问链接可知: Heroku Supported Runtimes Python

To solve this issue, simply create a runtime.txt file in root folder and add python-3.7.6要解决此问题,只需在根文件夹中创建一个runtime.txt文件并添加python-3.7.6

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

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