简体   繁体   English

由于构建包错误,Heroku 没有推送 Django 应用程序

[英]Heroku not pushing Django App due to buildpack error

I am trying to upload my Django project to Heroku with Python.我正在尝试使用 Python 将我的 Django 项目上传到 Heroku。

My app was built on Python 3.6.1 and when I go to push the app to heroku I am receiving the following error message in the terminal:我的应用程序是基于 Python 3.6.1 构建的,当我将应用程序推送到 heroku 时,我在终端中收到以下错误消息:

remote: Compressing source files... done.
remote: Building source:
remote: 
remote: -----> App not compatible with buildpack: https://codon-buildpacks.s3.amazonaws.com/buildpacks/heroku/python.tgz
remote:        More info: https://devcenter.heroku.com/articles/buildpacks#detection-failure
remote: 
remote:  !     Push failed
remote: Verifying deploy...
remote: 
remote: !   Push rejected to random-appio.

remote:偏僻的:

I have included a runtime.txt file containing the following:我已经包含了一个 runtime.txt 文件,其中包含以下内容:

python-3.6.1

I also have a Procfile containing:我还有一个 Procfile 包含:

web: sh -c "cd directory && gunicorn directory.wsgi"

As well as a requirements.txt file containing:以及一个 requirements.txt 文件,其中包含:

Django==2.0.2
gunicorn==19.7.1
pytz==2018.3
whitenoise==3.3.1

My requirements.txt, Procfile and runtime.txt are all in the project directory.我的requirements.txt、Procfile和runtime.txt都在项目目录下。

I can't see where I am going wrong here - any ideas?我看不出我哪里出错了 - 有什么想法吗?

Thanks everyone.谢谢大家。

我遇到过这种情况,我浏览了大约 3 个小时,然后我才知道我的文件被命名为 requirements.txt 的愚蠢错误,如果这没有帮助,它应该是 requirements.txt,请查看 heroku 站点上支持的 python 运行时版本

Veirify that the ".txt" in "requirements.txt" is not duplicated.验证“requirements.txt”中的“.txt”没有重复。

When I named the file, I explicitly typed requirements.txt which resulted in a file named当我命名文件时,我明确输入了 requirements.txt 这导致了一个名为

requirements.txt.txt that was not being detected.未检测到的 requirements.txt.txt。

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

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