简体   繁体   English

将Django应用程序推送到Heroku Master时出错

[英]Error while pushing django app to heroku master

When I push my django app to heroku master, I get an error about the version of python 当我将django应用推送到heroku master时,出现关于python版本的错误

I already added a file runtime.txt with python-3.7.2 and added python-3.7.2 to the requirements file. 我已经使用python-3.7.2添加了文件runtime.txt,并将python-3.7.2添加到了需求文件。

Collecting python-3.7.0 (from -r /tmp/build_56ed5608dd6394891e58f29a1dd224c2/requirements.txt (line 5)) remote: Could not find a version that satisfies the requirement python-3.7.0 (from -r /tmp/build_56ed5608dd6394891e58f29a1dd224c2/requirements.txt (line 5)) (from versions: ) remote: No matching distribution found for python-3.7.0 (from -r /tmp/build_56ed5608dd6394891e58f29a1dd224c2/requirements.txt (line 5)) 远程收集python-3.7.0(来自-r /tmp/build_56ed5608dd6394891e58f29a1dd224c2/requirements.txt(第5行))远程:找不到满足要求python-3.7.0的版本(来自-r / tmp / build_56ed5608dd6394891e58f29a1dd224c2 /要求。 txt(第5行))(从版本:)远程:找不到python-3.7.0的匹配发行版(从-r /tmp/build_56ed5608dd6394891e58f29a1dd224c2/requirements.txt(第5行))

I don't think you're supposed to have any "python" version in the requirements.txt. 我不认为您应该在requirements.txt.拥有任何“ python”版本requirements.txt. My requirements.txt is for a extremely basic application, but it only has this: 我的requirements.txt适用于极其基础的应用程序,但它只有以下内容:

gunicorn 
django-heroku
django

Requirements are for the "extra" things. 要求是针对“额外”事物的。 If you have the buildpack set up for python, I don't think you'll need it in requirements.txt at all. 如果您已经为python设置了buildpack ,我认为您根本不需要在requirements.txt中使用它。

I actually don't have a runtime.txt because heroku can configure that automatically, but I don't think that's the issue you're running into. 我实际上没有runtime.txt因为heroku可以自动配置它,但是我不认为这是您遇到的问题。

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

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