Heroku和Django:此应用程序无法检测到默认语言

时间:2018-06-08 15:31:22

标签: python django heroku python-3.6

我已按照教程(Link here)下的说明进行操作。我甚至将runtime.txt文件包含在适当版本的Python中。我到处搜索,但似乎没有解决办法。我的GitHub项目链接供参考:

https://github.com/MithilRocks/chakri

错误消息:

PS C:\Users\Mithil Bhoras\Documents\GitHub\chakri\chakri> git push heroku master
Counting objects: 90, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (80/80), done.
Writing objects: 100% (90/90), 8.78 MiB | 234.00 KiB/s, done.
Total 90 (delta 26), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote:
remote:  !     No default language could be detected for this app.
remote:                         HINT: This occurs when Heroku cannot detect the buildpack to use for this application automatically.
remote:                         See https://devcenter.heroku.com/articles/buildpacks
remote:
remote:  !     Push failed
remote: Verifying deploy...
remote:
remote: !       Push rejected to chakrilevels.
remote:
To https://git.heroku.com/chakrilevels.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/chakrilevels.git'

2 个答案:

答案 0 :(得分:0)

对于将来的读者,与@hansTheFranz的注释相同的解决方案,但从命令行进行:

  • 在创建应用时:heroku create --buildpack heroku/python app_name

  • 对于现有应用程序:heroku buildpacks:set heroku/python

此外,官方Heroku Buildpack: Python文档也可以提供帮助。

答案 1 :(得分:0)

你可以把requirements.txt通过小垃圾写到“r”而不是Requirements.txt 如果你没有requirements.txt文件 你应该制作这个文件 在“cmd”中可以写这一行

freeze > requirements.txt