没有默认的语言可以检测到这个应用程序

没有默认的语言可以检测到这个应用程序

本文介绍了heroku:没有默认的语言可以检测到这个应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

第一次使用Heroku。试图推动。我已经运行了这个命令:
$ b

heroku create --buildpack heroku / python



并显示出来

  $ heroku create --buildpack heroku / python 
创建应用程序。 ..完成,glacial-reef-7599
将buildpack设置为heroku / python ... done
https://glacial-reef-7599.herokuapp.com/ | https://git.heroku.com/glacial-reef-7599.git

堆栈跟踪:

  $ git push heroku master 
计数对象:129,完成。
使用多达8个线程的增量压缩。
压缩对象:100%(124/124),完成。
写作对象:100%(129/129),69.06 KiB | 0字节/秒,完成。
总计129(增量22),重用0(增量0)
远程:压缩源文件...完成。
远程:建立源:
远程:
远程:!这个应用程序没有检测到默认语言。
remote:HINT:当Heroku无法自动检测到此应用程序使用的buildpack时发生。
remote:请参阅https://devcenter.heroku.com/articles/buildpacks
remote:
remote:!推送失败
remote:验证部署...
remote:
remote:!拒绝拒绝纯荒地-9125。
remote:
到https://git.heroku.com/pure-badlands-9125.git
! [remote rejected] master - > master(pre-receive hook refused)
错误:未能推送一些文件到'https://git.heroku.com/pure-badlands-9125.git'

我必须缺少一些东西。



我添加了一个 requirements.txt 到我的根目录。它看起来像这样:

  .git 
.idea
projectapp
projectname
rango
db.sqlite3
manage.py
populate_rango.py
requirements.txt


解决方案

我不记得我是如何解决这个问题的,但是在我的文件中查看 Date Modified 在发布这个问题后,我创建了两个文件:

runtime.txt (感谢 rurp )其中包含:

  python-3.5.2 

Procfile 其中包含:

  web:gunicorn projectname.wsgi --log文件 -  

这是一个Django项目和 projectname.wsgi 会导致位于



处的 wsgi.py












 导入os 
导入信号

导入sys
导入回溯

i mport time
from django.core.wsgi import get_wsgi_application $ b $ from whitenoise.django import DjangoWhiteNoise
$ b os.environ.setdefault(DJANGO_SETTINGS_MODULE,projectname.settings)

application = get_wsgi_application()
application = DjangoWhiteNoise(application)


First time using Heroku. Trying to push. I have run the command:

heroku create --buildpack heroku/python

and it displayed

$ heroku create --buildpack heroku/python
Creating app... done, glacial-reef-7599
Setting buildpack to heroku/python... done
https://glacial-reef-7599.herokuapp.com/ | https://git.heroku.com/glacial-reef-7599.git

Stack trace:

$ git push heroku master
Counting objects: 129, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (124/124), done.
Writing objects: 100% (129/129), 69.06 KiB | 0 bytes/s, done.
Total 129 (delta 22), 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 pure-badlands-9125.
remote:
To https://git.heroku.com/pure-badlands-9125.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/pure-badlands-9125.git'

I've gotta be missing something.

I have added a requirements.txt to my root directory. It looks like this:

.git
.idea
projectapp
projectname
rango
db.sqlite3
manage.py
populate_rango.py
requirements.txt
解决方案

I can't remember how I fixed this but looking at the Date Modified in my files after I posted this question I created two files:

runtime.txt (thanks rurp) which contains:

python-3.5.2

Procfile which contains:

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

This is a Django project and projectname.wsgi leads to a wsgi.py located at

projectname/wsgi.py

This contains:

import os
import signal

import sys
import traceback

import time
from django.core.wsgi import get_wsgi_application
from whitenoise.django import DjangoWhiteNoise

os.environ.setdefault("DJANGO_SETTINGS_MODULE", "projectname.settings")

application = get_wsgi_application()
application = DjangoWhiteNoise(application)

这篇关于heroku:没有默认的语言可以检测到这个应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-26 14:15